data_structures.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:jack 作者: uclmr 项目源码 文件源码
def __init__(self, text: str, span: Tuple[int, int] = None, doc_idx: int = 0, score: float = 1.0):
        """
        Create a new answer.
        Args:
            text: The text string of the answer.
            span: For extractive QA, a span in the support documents. The triple `(start, end)`
                represents a span in support document with index `doc_index` in the ordered sequence of
            doc_idx: index of document where answer was found
            support documents. The span starts at `start` and ends at `end` (exclusive).
            score: the score a model associates with this answer.
        """
        assert span is None or len(span) == 2, "span should be (char_start, char_end) tuple"

        self.score = score
        self.span = span
        self.doc_idx = doc_idx
        self.text = text
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号