ontocast.tool.chunk.section_llm¶
LLM section-label backfill for chunk preparation.
ChunkSectionClassification
¶
Bases: BasePydanticModel
LLM output mapping one excerpt to a canonical section label.
Source code in ontocast/tool/chunk/section_llm.py
classify_section_with_llm(text, tools, schema, *, document_type_hint=None)
async
¶
Classify a text fragment with the section-label LLM prompt.
Source code in ontocast/tool/chunk/section_llm.py
fragment_for_text(text)
¶
Return a short excerpt suitable for LLM section classification.
Source code in ontocast/tool/chunk/section_llm.py
llm_backfill_section_labels(segments, tools, *, section_schema_id, document_type_hint=None, section_tag_min_chars=80)
async
¶
Set section_label on segments that are still unlabeled (mutates in place).