rag.core.passage¶
Passage selection helpers shared by RAG backends.
Attributes¶
Functions¶
|
Return True when the question is asking who wrote a paper. |
|
Return True when text looks like thanks / manuscript revision notes. |
|
Return True when text is SPIE copyright / volume-editor footer. |
|
Read a 1-based page number from chunk metadata. |
Module Contents¶
- rag.core.passage.AUTHOR_QUESTION_CUES: Final = ('who wrote', 'who is the writer', 'who is the author', 'who are the authors', 'who is the main...[source]¶
- rag.core.passage.ACKNOWLEDGEMENT_CUES: Final = ('acknowledg', 'thanks to', 'thank ', 'grateful to', 'careful revision', 'revising the...[source]¶
- rag.core.passage.PROCEEDINGS_BOILERPLATE_CUES: Final = ('edited by', 'proc. of spie', 'ccc code', 'spiedigitallibrary', 'terms of use')[source]¶
- rag.core.passage.QA_GROUNDING_RULES: Final = "People thanked for revising a manuscript are not authors. SPIE 'edited by' names are volume...[source]¶
- rag.core.passage.is_author_question(*, question: str) bool[source]¶
Return True when the question is asking who wrote a paper.
- Parameters:
question (str) – User question.
- Returns:
True when authorship cues are present.
- Return type:
bool
- rag.core.passage.is_acknowledgement_text(*, text: str) bool[source]¶
Return True when text looks like thanks / manuscript revision notes.
- Parameters:
text (str) – Chunk or page text.
- Returns:
True when acknowledgement phrasing dominates authorship lists.
- Return type:
bool