rag.core.passage ================ .. py:module:: rag.core.passage .. autoapi-nested-parse:: Passage selection helpers shared by RAG backends. Attributes ---------- .. autoapisummary:: rag.core.passage.AUTHOR_QUESTION_CUES rag.core.passage.ACKNOWLEDGEMENT_CUES rag.core.passage.PROCEEDINGS_BOILERPLATE_CUES rag.core.passage.QA_GROUNDING_RULES Functions --------- .. autoapisummary:: rag.core.passage.is_author_question rag.core.passage.is_acknowledgement_text rag.core.passage.is_proceedings_boilerplate_text rag.core.passage.page_from_mapping Module Contents --------------- .. py:data:: AUTHOR_QUESTION_CUES :type: Final :value: ('who wrote', 'who is the writer', 'who is the author', 'who are the authors', 'who is the main... .. py:data:: ACKNOWLEDGEMENT_CUES :type: Final :value: ('acknowledg', 'thanks to', 'thank ', 'grateful to', 'careful revision', 'revising the... .. py:data:: PROCEEDINGS_BOILERPLATE_CUES :type: Final :value: ('edited by', 'proc. of spie', 'ccc code', 'spiedigitallibrary', 'terms of use') .. py:data:: QA_GROUNDING_RULES :type: Final :value: "People thanked for revising a manuscript are not authors. SPIE 'edited by' names are volume... .. py:function:: is_author_question(*, question: str) -> bool Return True when the question is asking who wrote a paper. :param question: User question. :type question: str :returns: True when authorship cues are present. :rtype: bool .. py:function:: is_acknowledgement_text(*, text: str) -> bool Return True when text looks like thanks / manuscript revision notes. :param text: Chunk or page text. :type text: str :returns: True when acknowledgement phrasing dominates authorship lists. :rtype: bool .. py:function:: is_proceedings_boilerplate_text(*, text: str) -> bool Return True when text is SPIE copyright / volume-editor footer. :param text: Chunk or page text. :type text: str :returns: True when proceedings chrome is present. :rtype: bool .. py:function:: page_from_mapping(*, metadata: dict[str, Any]) -> int | None Read a 1-based page number from chunk metadata. :param metadata: Loader metadata. :type metadata: dict :returns: Page number when parseable. :rtype: int or None