argscichat_allennlp/argscichat_baselines/dataset_reader.py
def _get_facts_mask(facts: List[str], paragraphs: List[str], has_article) -> List[int]:
        """
        Takes a list of evidence snippets, and the list of all the paragraphs from the
        paper, and returns a list of indices of the paragraphs that contain the evidence.
        """

        if not len(paragraphs) or not has_article:
            return [0] * len(paragraphs)

        facts_mask = [0] * len(paragraphs)
        total_found = 0
        for fact in facts:
            filtered_fact = ArgSciChatReader._punctuation_filtering(fact)
            for paragraph_idx, paragraph in enumerate(paragraphs):
                filtered_paragraph = ArgSciChatReader._punctuation_filtering(paragraph)
                if filtered_fact in filtered_paragraph:
                    facts_mask[paragraph_idx] = 1
                    total_found += 1
                    break

        assert total_found == len(facts), "Got {0} facts but facts mask has {1} 1s".format(len(facts), total_found)
        return facts_mask

        Takes a list of evidence snippets, and the list of all the paragraphs from the
        paper, and returns a list of indices of the paragraphs that contain the evidence.
        
Takes a list of evidence snippets, and the list of all the paragraphs from the
paper, and returns a list of indices of the paragraphs that contain the evidence.
Takes a list of evidence snippets and the list of all the paragraphs from the paper and returns a list of indices of the paragraphs that contain the evidence .
def _get_facts_mask(facts: List[str], paragraphs: List[str], has_article) -> List[int]:
        if not len(paragraphs) or not has_article:
            return [0] * len(paragraphs)
        facts_mask = [0] * len(paragraphs)
        total_found = 0
        for fact in facts:
            filtered_fact = ArgSciChatReader._punctuation_filtering(fact)
            for paragraph_idx, paragraph in enumerate(paragraphs):
                filtered_paragraph = ArgSciChatReader._punctuation_filtering(paragraph)
                if filtered_fact in filtered_paragraph:
                    facts_mask[paragraph_idx] = 1
                    total_found += 1
                    break
        assert total_found == len(facts), "Got {0} facts but facts mask has {1} 1s".format(len(facts), total_found)
        return facts_mask
def _get_facts_mask ( facts : List [ str ] , paragraphs : List [ str ] , has_article ) -> List [ int ] : if not len ( paragraphs ) or not has_article : return [ 0 ] * len ( paragraphs ) facts_mask = [ 0 ] * len ( paragraphs ) total_found = 0 for fact in facts : filtered_fact = ArgSciChatReader . _punctuation_filtering ( fact ) for paragraph_idx , paragraph in enumerate ( paragraphs ) : filtered_paragraph = ArgSciChatReader . _punctuation_filtering ( paragraph ) if filtered_fact in filtered_paragraph : facts_mask [ paragraph_idx ] = 1 total_found += 1 break assert total_found == len ( facts ) , "Got {0} facts but facts mask has {1} 1s" . format ( len ( facts ) , total_found ) return facts_mask
Takes a list of evidence snippets, and the list of all the paragraphs from the
paper, and returns a list of indices of the paragraphs that contain the evidence.
Takes a list of evidence snippets and the list of all the paragraphs from the paper and returns a list of indices of the paragraphs that contain the evidence .
"""
        Takes a list of evidence snippets, and the list of all the paragraphs from the
        paper, and returns a list of indices of the paragraphs that contain the evidence.
        """
facts
List[str]
paragraphs
List[str]
has_article