Skip to content

Commit edeb131

Browse files
merge
2 parents c294aaf + 4c73f42 commit edeb131

109 files changed

Lines changed: 1425 additions & 2248 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/sync-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ sync:
55
dest: resources/nltk_data/
66
- source: resources/examples/
77
dest: resources/examples/
8-
- source: resources/images/logo.png
9-
dest: resources/images/logo.png
8+
- source: assets/logo.png
9+
dest: assets/logo.png
1010
- source: webui/
1111
dest: webui/
1212
- source: webui/app.py

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="resources/images/logo.png"/>
2+
<img src="assets/logo.png"/>
33
</p>
44

55
<!-- icon -->
@@ -315,7 +315,7 @@ See [analysis](https://deepwiki.com/open-sciencelab/GraphGen) by deepwiki for a
315315

316316

317317
### Workflow
318-
![workflow](resources/images/flow.png)
318+
![workflow](assets/flow.png)
319319

320320

321321
## 🍀 Acknowledgements

README_zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="resources/images/logo.png"/>
2+
<img src="assets/logo.png"/>
33
</p>
44

55
<!-- icon -->
@@ -313,7 +313,7 @@ GraphGen 首先根据源文本构建细粒度的知识图谱,然后利用期
313313

314314

315315
### 工作流程
316-
![workflow](resources/images/flow.png)
316+
![workflow](assets/flow.png)
317317

318318

319319
## 🍀 致谢

baselines/BDS/bds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from graphgen.bases import BaseLLMWrapper
1111
from graphgen.common import init_llm
12-
from graphgen.models import NetworkXStorage
12+
from graphgen.storage import NetworkXStorage
1313
from graphgen.utils import create_event_loop
1414

1515
QA_GENERATION_PROMPT = """

examples/evaluate/evaluate_kg/kg_evaluation_config.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ nodes:
1010
dependencies: []
1111
params:
1212
input_path:
13-
- examples/input_examples/extract_demo.txt
13+
- examples/input_examples/jsonl_demo.jsonl
1414

1515
- id: chunk
1616
op_name: chunk
@@ -39,7 +39,6 @@ nodes:
3939
dependencies:
4040
- build_kg
4141
params:
42+
target: kg
4243
metrics:
43-
- kg_structure
44-
- kg_accuracy
45-
- kg_consistency
44+
- structure

examples/evaluate/evaluate_qa/qa_evaluation_config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
global_params:
22
working_dir: cache
3-
graph_backend: kuzu # graph database backend, support: kuzu, networkx
4-
kv_backend: rocksdb # key-value store backend, support: rocksdb, json_kv
3+
graph_backend: networkx # graph database backend, support: kuzu, networkx
4+
kv_backend: json_kv # key-value store backend, support: rocksdb, json_kv
55

66
nodes:
77
- id: read_files # id is unique in the pipeline, and can be referenced by other steps
@@ -89,10 +89,11 @@ nodes:
8989
batch_size: 128
9090
save_output: true
9191
params:
92+
target: qa
9293
metrics:
93-
- qa_length
94-
- qa_mtld
95-
- qa_reward_score
96-
- qa_uni_score
94+
- length
95+
- mtld
96+
# - reward_score
97+
# - uni_score
9798
mtld_params:
9899
threshold: 0.7
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
python3 -m graphgen.run \
2+
--config_file examples/evaluate/evaluate_triple/triple_evaluation_config.yaml
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
global_params:
2+
working_dir: cache
3+
graph_backend: networkx # graph database backend, support: kuzu, networkx
4+
kv_backend: json_kv # key-value store backend, support: rocksdb, json_kv
5+
6+
nodes:
7+
- id: read
8+
op_name: read
9+
type: source
10+
dependencies: []
11+
params:
12+
input_path:
13+
- examples/input_examples/jsonl_demo.jsonl
14+
15+
- id: chunk
16+
op_name: chunk
17+
type: map_batch
18+
dependencies:
19+
- read
20+
execution_params:
21+
replicas: 4
22+
params:
23+
chunk_size: 20480 # larger chunk size for better context
24+
chunk_overlap: 2000
25+
26+
- id: build_kg
27+
op_name: build_kg
28+
type: map_batch
29+
dependencies:
30+
- chunk
31+
execution_params:
32+
replicas: 1
33+
batch_size: 128
34+
35+
- id: evaluate
36+
op_name: evaluate
37+
type: aggregate
38+
save_output: true
39+
dependencies:
40+
- build_kg
41+
params:
42+
target: triple
43+
src_namespace: chunk
44+
tgt_namespace: build_kg
45+
metrics:
46+
- accuracy

0 commit comments

Comments
 (0)