Esempio n. 1
0
 def test_with_json(self):
     sample = {
         "firstName": "jayne",
         "lastName": "cobb",
         "isMale": True,
         "age": 38
     }
     verify_as_json(sample)
Esempio n. 2
0
    def test_parsing_of_robust04_without_transformation(self):
        transformed_document_sample = transform_documents_and_select_entries_by_id(
            conf=self.parameters(collection_directory=
                                 'collection_to_doc_vectors/test/data/robust',
                                 pyserini_collection='TrecCollection',
                                 pyserini_generator='JsoupGenerator',
                                 sample=LA_TIMES_SAMPLE))

        verify_as_json(transformed_document_sample)
Esempio n. 3
0
    def test_parsing_of_clueweb09_without_transformation(self):
        transformed_document_sample = transform_documents_and_select_entries_by_id(
            conf=self.parameters(
                collection_directory=
                'collection_to_doc_vectors/test/data/clueweb09-sample',
                pyserini_collection='ClueWeb09Collection',
                pyserini_generator='JsoupGenerator',
                sample=CLUEWEB_SAMPLE))

        verify_as_json(transformed_document_sample)
    def test_reconstruction_with_single_input_line(self):
        run_file = [
            '''[
                {"system":"s1", "query":690, "docid": "FT944-12903", "rank": 1, "score": 10.0},
                {"system":"s1", "query":690, "docid": "LA110789-0114", "rank": 2, "score": 9.0},
                {"system":"s1", "query":690, "docid": "FT931-16546", "rank": 3, "score": 8.0}]'''
        ]
        reduce_output = open('test/BuildTrainingSetTest.test_reducer_on_map_output_with_single_input_line.approved.txt')\
            .read().split('\n')

        verify_as_json(
            self.bla(self.system_ranks(run_file),
                     self.parse_relevance('test/test-qrels.txt'),
                     self.parse_bm25_run('test/test-run.txt'), reduce_output))
    def test_with_main_content_extraction_and_word_vectors(self):
        transformed_document_sample = transform_documents_and_select_entries_by_id(
            conf=self.parameters(extract_main_content=True,
                                 transform_to_word_vectors=True))

        verify_as_json(transformed_document_sample)
    def test_transformation_to_word_vectors(self):
        transformed_document_sample = transform_documents_and_select_entries_by_id(
            conf=self.parameters(transform_to_word_vectors=True))

        verify_as_json(transformed_document_sample)
    def test_no_transformation(self):
        transformed_document_sample = transform_documents_and_select_entries_by_id(
            conf=self.parameters())

        verify_as_json(transformed_document_sample)
Esempio n. 8
0
    def test_web_qrel_251_300_run_file_count(cls):
        actual = list_run_files_of_qrel_file(
            'artificial-qrels/qrels.inofficial.duplicate-free.web.251-300.txt')

        verify_as_json(sorted(actual))
Esempio n. 9
0
    def test_web_qrel_1_50_run_file_count(cls):
        actual = list_run_files_of_qrel_file(
            'resources/artificial-qrels/qrels.inofficial.duplicate-free.web.1-50.txt'
        )

        verify_as_json(sorted(actual))
Esempio n. 10
0
    def test_web_2012_run_file_count(cls):
        actual = list_run_files_of_qrel_file('qrels-web-2012')

        verify_as_json(sorted(actual))
    def test_generation_for_small_sample_qrels(self):
        actual = generate_pairs_from_qrels('test/sample-small-qrels.txt')

        verify_as_json([i for i in actual])