-
Notifications
You must be signed in to change notification settings - Fork 23
Add paper quality filter script and documentation #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Narabzad
wants to merge
15
commits into
main
Choose a base branch
from
datapipeline_testing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add filter_quality_papers.py: Filter papers based on related works quality and citation count - Add batch_filter_papers.sh: Batch process multiple output folders - Update README.md: Add Step 5 (Quality Filtering) to pipeline documentation - Update .gitignore: Exclude data_pipeline/outputs/ folder from version control - Add quality presets (Strict, Standard, Lenient, Surveys) for different use cases - Filter criteria: related works presence, length bounds (200-10000 chars), min citations (5) - Successfully tested on 465 papers with 89% pass rate (414 papers filtered)
- Add create_sample_dataset.py: Create complete sampled datasets with all related files - Add sample_papers_by_category.py: Stratified sampling by category distribution - Add outputs_oct/: 100-paper sample dataset with citations, related works, and LaTeX sources - Sampling method: Stratified random sampling maintaining category proportions - Categories: 29 CV, 17 LG, 9 SE, 8 HC, 6 RO, and 13 other CS categories - Includes: papers.csv, paper_content.csv, citations/, related_works/, latex_source/ - All papers meet quality criteria: related works present, 5+ citations, 200-10K chars - Random seed 42 for reproducibility
…nce citation counts - Updated generate_nuggets_from_reports.py to work with data pipeline output structure - Enhanced get_important_citations.py with flexible column mapping - Added comprehensive documentation to README.md - Created PULL_REQUEST.md documenting all new features - Added nuggets generation for ground truth reports - Added important citation filtering for ground truth reports - Integrated reference citation counts using OpenAlex API
…ence citation counts - Updated generate_nuggets_from_reports.py to work with data pipeline output structure - Enhanced get_important_citations.py with flexible column mapping - Added comprehensive documentation to README.md - Created PULL_REQUEST.md documenting all new features - Added nuggets generation for ground truth reports - Added important citation filtering for ground truth reports - Integrated reference citation counts using OpenAlex API
Oct dataset
…e_p None handling, and deepscholar_base citations_for_cite_quality
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request: Add Ground Truth Generation Features to Data Pipeline
🎯 Summary
This PR adds comprehensive ground truth generation capabilities to the data pipeline, including:
📝 Changes
New Files
filter_quality_papers.py- Main filtering scriptbatch_filter_papers.sh- Batch processing utilityModified Files
generate_nuggets_from_reports.py- Enhanced nugget generation scriptnuggets/{arxiv_id}/res.jsonget_important_citations.py- Enhanced important citation filteringpaper_title/titleandrelated_works_section/clean_latex_related_works)README.md- Updated documentation.gitignore- Updated ignore rulesdata_pipeline/outputs/to prevent large datasets from being tracked✨ Features
1. Nugget Generation for Ground Truth Reports
nuggets/{arxiv_id}/res.jsonfiles matching evaluation format--skip_existingflag2. Important Citation Filtering for Ground Truth Reports
3. Reference Citation Counts for Ground Truth Reports
4. Quality Filtering
Quality Presets
Key Benefits
📊 Testing Results
Tested on real dataset (
outputs/20251015_143311/):Nugget Generation
nuggets/{arxiv_id}/res.jsonfiles for each paperImportant Citation Filtering
important_citations.csv(6.4 MB)Quality Filtering
Category Distribution (filtered papers):
🚀 Usage Examples
Generate Nuggets for Ground Truth Reports
python data_pipeline/generate_nuggets_from_reports.py \ --input_dir outputs/20251015_143311 \ --model gpt-4oFilter Important Citations for Ground Truth Reports
python -m data_pipeline.get_important_citations \ --citation_input_file outputs/20251015_143311/all_citations.csv \ --related_works_input_file outputs/20251015_143311/paper_content_filtered_with_citations.csv \ --model gpt-4o \ --output_file outputs/20251015_143311/important_citations.csvAdd Reference Citation Counts for Ground Truth Reports
python -m data_pipeline.add_reference_citations \ --papers-csv outputs/20251015_143311/paper_content_filtered.csv \ --citations-folder outputs/citations \ --output-csv outputs/20251015_143311/paper_content_filtered_with_citations.csvQuality Filtering (Standard Quality)
Batch Process All Folders
Custom Thresholds (High Quality)
python filter_quality_papers.py \ --input-folder outputs/20251015_143311/ \ --min-citations 10 \ --min-rw-length 500 \ --max-rw-length 8000📁 Output Files
Ground Truth Generation Outputs
Nuggets (
nuggets/folder):nuggets/{arxiv_id}/res.json- Nugget analysis for each paperImportant Citations:
important_citations.csv- Filtered important citations only (22-23% of total citations)Reference Citation Counts:
paper_content_filtered_with_citations.csv- Papers with reference citation countsQuality Filtering Outputs
For each filtered folder, creates:
paper_content_filtered.csv- Filtered paper data with related workspapers_filtered.csv- Filtered paper metadata🔄 Integration with Existing Pipeline
The complete ground truth generation pipeline:
main.py) - Collects papers and citationsrecover_citations.py) - Enhances citation metadataget_important_citations.py) - Identifies important citations ← UPDATEDgenerate_nuggets_from_reports.py) - Extracts nuggets from related works ← UPDATEDfilter_quality_papers.py) - Filters high-quality papers ← NEWadd_reference_citations.py) - Adds citation counts for referencesAll steps can be run independently on any existing output folder.
None. This is a purely additive feature that:
_filteredsuffix (doesn't overwrite)✅ Checklist
📚 Documentation
All documentation has been merged into the main
README.md:🤔 Future Enhancements (Optional)
Potential future improvements (not in this PR):
commentsfield for accepted papers only🙏 Review Notes
🔧 Recent Evaluation Fixes and Bug Discoveries
Evaluation System Improvements
This PR also includes several fixes to the evaluation system discovered during testing:
1. Document Importance Normalization Fix
eval/evaluator/document_importance.py2. Cite-P None Handling
TypeError: 'NoneType' object is not subscriptablewhencitations_for_cite_qualitywas Noneeval/evaluator/cite_p.py3. Organization Evaluator Score Transparency
organization_v1andorganization_v2columns to results CSV showing individual round scores, plus finalorganizationscore as averageeval/evaluator/organization.py4. DeepScholar Base Parser Citation Fix
citations_for_cite_qualitywas not set for DeepScholar Base parser, causing cite-p evaluation failurescitations_for_cite_qualityfrom parser docseval/parsers/deepscholar_base.py5. Minor Parsing Bug Fixes
During evaluation testing, two issues were discovered that require further investigation:
1. Organization Evaluator Positional Bias
Issue: The organization evaluator consistently outputs that "B" is better organized, regardless of content quality or position swapping.
2. Reference Coverage Always Returns 0
Issue: Reference coverage evaluator consistently returns 0.0 for all papers, suggesting citations are not being matched correctly.