build_graph
Function
Creates a text index and generates a knowledge graph of the corresponding text.
Prototype
def build_graph(lang, pad_token, conceptualize, **kwargs)
Parameters
Parameter |
Data Type |
Required/Optional |
Description |
|---|---|---|---|
lang |
Lang |
Optional |
Corpus language. The default value is Lang.EN (English corpus). |
pad_token |
String |
Optional |
LLM's padding token, which is an empty character by default. The value range is [0, 255]. |
conceptualize |
Bool |
Optional |
Whether to conceptualize nodes. The default value is False. |
kwargs |
Dict |
Optional |
Extended parameters:
|
Return Value
None.
After this method is executed, the following process files are generated in work_dir.
File |
Description |
|---|---|
"{graph_name}.json" |
Stores graphs. If graph_type is set to networkx, graphs are loaded using this file during retrieval. |
"{graph_name}_relations.json" |
Stores entity relationship information. |
"{graph_name}_concepts.json" |
Stores concept information. |
"{graph_name}_synset.json" |
Stores the category information after concept clustering. |
"{graph_name}_node_vectors.index" |
Stores vector indexes of entities. |
"{graph_name}_concept_vectors.index" |
Stores vector indexes of concepts. |