Consolidate entry points #70
Conversation
There was a problem hiding this comment.
Pull request overview
This PR consolidates the previously separate “extract from pre-classified .txt” workflow into the main classify_extract.py entry point (via --skip-classifier), updates documentation accordingly, and makes a small test robustness improvement.
Changes:
- Merged the former
extract_from_txt.pypipeline intosrc/pipeline/classify_extract.pybehind--skip-classifier, including label filtering and chunked extraction options. - Updated docs (
README.md,documentation/CONTRIBUTING.md,documentation/DESIGN_DECISIONS.md) to reflect the consolidated entry point and removal of the old script. - Updated
tests/test_pdf_extraction.pyto invoke the CLI withsys.executableinstead of hardcodingpython.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/pipeline/classify_extract.py |
Adds --skip-classifier TXT extraction path and consolidates shared extraction/preprocess logic into one entry point. |
src/pipeline/extract_from_txt.py |
Removes the standalone TXT pipeline script now that its functionality is consolidated. |
documentation/CONTRIBUTING.md |
Documents the new TXT extraction usage/flags and updates guidance on where extraction fields are maintained. |
README.md |
Adds a CLI example for extracting from pre-classified .txt inputs using --skip-classifier. |
documentation/DESIGN_DECISIONS.md |
Records the design decision to merge the former extract-from-txt entry point into classify_extract.py. |
tests/test_pdf_extraction.py |
Uses sys.executable to ensure the test runs with the active interpreter. |
data/processed-text/test.txt |
Adds a sample .txt file intended for demonstration/testing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| filtered, trimmed, counts, err = _preprocess_text( | ||
| raw_text, | ||
| max_chars, | ||
| stem=source_file.stem, | ||
| save_intermediates=save_intermediates, | ||
| cleaner_dir=cleaner_dir, | ||
| filter_dir=filter_dir, | ||
| llm_dir=llm_dir if not chunked else None, | ||
| ) |
| [PAGE 1] | ||
| CS 331: Introduction to Artificial | ||
| Intelligence | ||
| Lecture 2: Agents | ||
| Sandhya Saisubramanian |
There was a problem hiding this comment.
Implemented in cac2c1b: replaced /data/processed-text/test.txt with a short synthetic, project-relevant predator-diet sample text.
|
Retargeted base from |
|
This branch has merge conflicts with Content conflicts:
Modify/delete conflict:
To rebase: git fetch origin
git rebase origin/dev
# resolve conflicts, then:
git push --force-with-lease |
Added instructions and CLI flags for processing pre-classified
.txtfiles using the--skip-classifierflag inclassify_extract.pyto bothREADME.mdanddocumentation/CONTRIBUTING.md. This allows users to extract from.txtfiles directly, with options for chunked extraction and label filtering. [1] [2]Updated the summary of extraction fields in
documentation/CONTRIBUTING.mdto remove references to the obsoleteextract_from_txt.pyand clarify that new fields should be added toclassify_extract.py.Updated
documentation/DESIGN_DECISIONS.mdto document thatextract_from_txt.pywas merged intoclassify_extract.pyas part of the new--skip-classifierworkflow.Updated the test in
tests/test_pdf_extraction.pyto usesys.executableinstead of hardcoding"python", ensuring the correct Python interpreter is used during test execution.Added a new sample file
data/processed-text/test.txtfor demonstration or testing purposes.