Spaces:
Build error
Build error
Download data_ingestion/ingest_data.py from Proton-Datalabs-dev/Smart-Tasker: direct link, hf CLI and curl.
- Browser
- Download file 390 Bytes
-
https://huggingface.co/spaces/Proton-Datalabs-dev/Smart-Tasker/resolve/main/data_ingestion/ingest_data.py
- Command line
-
hf download hf://spaces/Proton-Datalabs-dev/Smart-Tasker/data_ingestion/ingest_data.py
-
curl -L -o ingest_data.py https://huggingface.co/spaces/Proton-Datalabs-dev/Smart-Tasker/resolve/main/data_ingestion/ingest_data.py
390 Bytes
| # data_ingestion/ingest_data.py | |
| from docx import Document | |
| def read_document(file_path): | |
| """Reads a Word document and extracts text content from each line.""" | |
| document = Document(file_path) | |
| text_data = [] | |
| for para in document.paragraphs: | |
| line = para.text.strip() | |
| if line: # Only add non-empty lines | |
| text_data.append(line) | |
| return text_data | |