MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / parse_pdf

Function parse_pdf

skills/pdf-parser/scripts/parse_pdf.py:627–643  ·  view source on GitHub ↗

解析 PDF

(pdf_path: str)

Source from the content-addressed store, hash-verified

625
626
627def parse_pdf(pdf_path: str) -> Dict:
628 """解析 PDF"""
629 text = extract_text_from_pdf(pdf_path)
630 metadata = extract_metadata(text)
631 sections = extract_sections(text)
632 directions = infer_research_directions(text)
633 methodology_preferences = infer_methodology_preferences(text, sections)
634 inferred_topics = infer_topics(text, directions)
635
636 return {
637 **metadata,
638 "sections": sections,
639 "inferred_directions": directions,
640 "methodology_preferences": methodology_preferences,
641 "inferred_topics": inferred_topics,
642 "full_text": text
643 }
644
645
646def parse_paper_for_coldstart(pdf_path: str) -> Dict:

Callers 1

Calls 6

extract_text_from_pdfFunction · 0.85
extract_metadataFunction · 0.85
extract_sectionsFunction · 0.85
infer_topicsFunction · 0.85

Tested by

no test coverage detected