XLSX
gllm-docproc | Tutorial: XLSX Loader | Use Case: Advanced DPO Pipeline | API Reference
XLSX Loader is a component designed for extracting information from XLSX documents and converting it into a standardized JSON format.
Installation
# you can use a Conda environment
pip install --extra-index-url https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/ "gllm-docproc[xlsx]"# you can use a Conda environment
$token = (gcloud auth print-access-token)
pip install --extra-index-url "https://oauth2accesstoken:$token@glsdk.gdplabs.id/gen-ai-internal/simple/" "gllm-docproc[xlsx]"# you can use a Conda environment
FOR /F "tokens=*" %T IN ('gcloud auth print-access-token') DO SET TOKEN=%T
pip install --extra-index-url "https://oauth2accesstoken:%TOKEN%@glsdk.gdplabs.id/gen-ai-internal/simple/" "gllm-docproc[xlsx]"You can use the following as a sample file: xlsx-example.xlsx.
Openpyxl Loader
OpenpyxlLoader is responsible to extract Table within XLSX document.
1
Create a script called main.py:
from gllm_docproc.loader.xlsx import OpenpyxlLoader
source = "./data/source/xlsx-example.xlsx"
# initialize the OpenpyxlLoader
loader = OpenpyxlLoader()
# load the xlsx source
loaded_elements = loader.load(source)2
Run the script:
python main.py3
The loader will generate the following: output JSON.
Last updated