def build_v2_1_graph_for_pro(pro_name):
    builder = CodeGraphBuilder()
    input_graph_data_path = PathUtil.graph_data(pro_name=pro_name,
                                                version="v2")
    print(input_graph_data_path)
    output_graph_data_path = PathUtil.graph_data(pro_name=pro_name,
                                                 version="v2_1")
    domain_concept_output_dir = PathUtil.domain_concept_dir(pro_name=pro_name,
                                                            version="v2")
    builder.build_v2_graph(pro_name=pro_name,
                           input_graph_data_path=input_graph_data_path,
                           output_graph_data_path=output_graph_data_path,
                           domain_concept_output_dir=domain_concept_output_dir)
예제 #2
0
        EntityReader.write_line_data(
            str(Path(domain_dir) / "mention_num.txt"),
            [str(v) + ":" + str(k) for k, v in self.mention_time.items()])
        EntityReader.write_line_data(
            str(Path(domain_dir) / "sum_mention_time.txt"),
            [str(v) + ":" + str(k) for k, v in self.sum_mention_time.items()])

        EntityReader.write_line_data(
            str(Path(domain_dir) / "end_related_relation_num.txt"), [
                str(v) + ":" + str(k)
                for k, v in self.end_related_relation_num.items()
            ])


if __name__ == "__main__":
    domain_dir = PathUtil.domain_concept_dir("JabRef-2.6", version="v1")
    domain_dir = Path(domain_dir)
    term_save_path = str(domain_dir / "terms.txt")
    operation_save_path = str(domain_dir / "operations.txt")
    term_relation_save_path = str(domain_dir / "relations.json")
    linkage_save_path = str(domain_dir / "linkages.json")
    aliase_save_path = str(domain_dir / "aliases.json")

    pre_doc_collection_out_path = PathUtil.pre_doc(pro_name="JabRef-2.6",
                                                   version="v2",
                                                   pre_way="code-pre")

    reduce = ReduceDomainTerm(term_save_path, operation_save_path,
                              term_relation_save_path, linkage_save_path,
                              aliase_save_path, pre_doc_collection_out_path)
    delete_based_on_name = reduce.delete_based_on_name()