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

Function infer_topics

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

Extract a small set of explicit topic phrases for profile bootstrapping.

(text: str, directions: List[Dict[str, Any]])

Source from the content-addressed store, hash-verified

611
612
613def infer_topics(text: str, directions: List[Dict[str, Any]]) -> List[str]:
614 """Extract a small set of explicit topic phrases for profile bootstrapping."""
615 text_lower = text.lower()
616 topics = []
617 for pattern in TOPIC_PATTERNS:
618 if pattern in text_lower and pattern not in topics:
619 topics.append(pattern)
620 for direction in directions:
621 normalized = direction["name"].lower()
622 if normalized not in topics:
623 topics.append(normalized)
624 return topics[:8]
625
626
627def parse_pdf(pdf_path: str) -> Dict:

Callers 1

parse_pdfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected