<jupyter_start><jupyter_text>Add concepts and concept links<jupyter_code>edges_cc = pd.read_csv(root_dir+"\\data\\og\\edges_cc.csv")
unique_concepts = list(set(edges_cc.values.flatten()))
for concept in unique_concepts:
    if concept == concept:
        KG.add_node(concept, node_type = "concept")
for i in range(len(edges_cc)):
    KG.add_edges_from(
        [(edges_cc.src[i], edges_cc.dst[i])])
print("Edges: ", len(list(KG.edges(data=True))))
print("Nodes: ", len(list(KG.nodes(data=True))))<jupyter_output>Edges:  313640
Nodes:  48857<jupyter_text>Save/export graph<jupyter_code>nx.write_gpickle(KG, "KG_concepts.gpickle")
#KG = nx.read_gpickle("KG_concepts.gpickle")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16358463726884778, 'fraction_numerical': 0.015647226173541962, 'mean_word_length': 6.822222222222222, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '76610', 'license': 'MIT', 'n_tokens_mistral': 301, 'n_tokens_neox': 279, 'n_words': 36, 'path': 'dev code/graph construction/Partial Knowledge Graph Construction (All Concepts).ipynb', 'repo_name': 'lucasmccabe/covid19-link-prediction', 'size': '703'}