Exemplo n.º 1
0
 def test_create_content(self):
     file_path_content_analyzer = os.path.join(
         THIS_DIR, "../../test/content_analyzer/movielens_test*")
     entity_linking_pipeline = FieldRepresentationPipeline(
         BabelPyEntityLinking())
     plot_config = FieldConfig(None)
     plot_config.append_pipeline(entity_linking_pipeline)
     content_analyzer_config = ContentAnalyzerConfig(
         'ITEM', JSONFile(file_path), ["imdbID"], "movielens_test")
     content_analyzer_config.append_field_config("Plot", plot_config)
     content_analyzer = ContentAnalyzer(content_analyzer_config)
     content_analyzer.fit()
     """
    def test_create_content(self):
        filepath = '../../datasets/movies_info_reduced.json'
        try:
            with open(filepath):
                pass
        except FileNotFoundError:
            filepath = 'datasets/movies_info_reduced.json'

        entity_linking_pipeline = FieldRepresentationPipeline(
            BabelPyEntityLinking())
        plot_config = FieldConfig(None)
        plot_config.append_pipeline(entity_linking_pipeline)
        content_analyzer_config = ContentAnalyzerConfig(
            'ITEM', JSONFile(filepath), ["imdbID"], "movielens_test")
        content_analyzer_config.append_field_config("Plot", plot_config)
        content_analyzer = ContentAnalyzer(content_analyzer_config)
        content_analyzer.fit()