Skip to content

Commit a1f0464

Browse files
committed
change 0.8.0 config
1 parent 2e77f1e commit a1f0464

14 files changed

Lines changed: 269 additions & 236 deletions

kag/examples/FinAlibaba/kag_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ kag_solver_pipeline:
179179
executors:
180180
- *retriever
181181
generator:
182-
type: llm_generator
182+
type: llm_index_generator
183183
llm_client: *chat_llm
184184
generated_prompt:
185185
type: default_multi_hop_generator

kag/examples/baike/kag_config.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ graph_api: &graph_api
7474
type: openspg_graph_api #kag.solver.tools.graph_api.impl.openspg_graph_api.OpenSPGGraphApi
7575

7676

77+
7778
kg_cs: &kg_cs
7879
type: kg_cs_open_spg
80+
priority: 0
7981
path_select:
8082
type: exact_one_hop_select
8183
graph_api: *graph_api
@@ -87,9 +89,14 @@ kg_cs: &kg_cs
8789
recognition_threshold: 0.9
8890
exclude_types:
8991
- Chunk
92+
- AtomicQuery
93+
- KnowledgeUnit
94+
- Summary
95+
- Outline
96+
- Doc
9097

9198
kg_fr: &kg_fr
92-
type: kg_fr_open_spg
99+
type: kg_fr_knowledge_unit
93100
top_k: 20
94101
graph_api: *graph_api
95102
search_api: *search_api
@@ -111,12 +118,18 @@ kg_fr: &kg_fr
111118
recognition_threshold: 0.8
112119
exclude_types:
113120
- Chunk
121+
- AtomicQuery
122+
- KnowledgeUnit
123+
- Summary
124+
- Outline
125+
- Doc
114126

115127
rc: &rc
116128
type: rc_open_spg
117129
vector_chunk_retriever:
118-
type: vector_chunk_retriever_legacy
130+
type: vector_chunk_retriever
119131
vectorize_model: *vectorize_model
132+
score_threshold: 0.65
120133
search_api: *search_api
121134
graph_api: *graph_api
122135
search_api: *search_api
@@ -131,16 +144,20 @@ kag_hybrid_executor: &kag_hybrid_executor_conf
131144
- *rc
132145
merger:
133146
type: kag_merger
134-
enable_summary: true
147+
enable_summary: true
135148

136149
kag_output_executor: &kag_output_executor_conf
137150
type: kag_output_executor
151+
llm_module: *chat_llm
152+
138153
kag_deduce_executor: &kag_deduce_executor_conf
139154
type: kag_deduce_executor
155+
llm_module: *chat_llm
140156

141157
py_code_based_math_executor: &py_code_based_math_executor_conf
142158
type: py_code_based_math_executor
143-
llm: *openie_llm
159+
llm: *chat_llm
160+
144161

145162
kag_solver_pipeline:
146163
type: kag_static_pipeline
@@ -157,7 +174,7 @@ kag_solver_pipeline:
157174
- *kag_deduce_executor_conf
158175
- *kag_output_executor_conf
159176
generator:
160-
type: llm_generator
177+
type: llm_index_generator
161178
llm_client: *chat_llm
162179
generated_prompt:
163180
type: default_refer_generator_prompt

kag/examples/csqa/kag_config.yaml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ chain_vectorizer:
7979

8080
kg_cs: &kg_cs
8181
type: kg_cs_open_spg
82+
priority: 0
8283
path_select:
8384
type: exact_one_hop_select
8485
graph_api: *graph_api
@@ -90,6 +91,11 @@ kg_cs: &kg_cs
9091
recognition_threshold: 0.9
9192
exclude_types:
9293
- Chunk
94+
- AtomicQuery
95+
- KnowledgeUnit
96+
- Summary
97+
- Outline
98+
- Doc
9399

94100
kg_fr: &kg_fr
95101
type: kg_fr_open_spg
@@ -114,28 +120,24 @@ kg_fr: &kg_fr
114120
recognition_threshold: 0.8
115121
exclude_types:
116122
- Chunk
123+
- AtomicQuery
124+
- KnowledgeUnit
125+
- Summary
126+
- Outline
127+
- Doc
117128

118129
rc: &rc
119130
type: rc_open_spg
120131
vector_chunk_retriever:
121-
type: vector_chunk_retriever_legacy
132+
type: vector_chunk_retriever
122133
vectorize_model: *vectorize_model
134+
score_threshold: 0.65
123135
search_api: *search_api
124136
graph_api: *graph_api
125137
search_api: *search_api
126138
vectorize_model: *vectorize_model
127139
top_k: 20
128140

129-
kag_merger:
130-
type: kg_merger
131-
top_k: 20
132-
llm_module: *chat_llm
133-
summary_prompt:
134-
type: default_thought_then_answer
135-
vectorize_model: *vectorize_model
136-
graph_api: *graph_api
137-
search_api: *search_api
138-
139141
kag_hybrid_executor: &kag_hybrid_executor_conf
140142
type: kag_hybrid_retrieval_executor
141143
retrievers:
@@ -144,19 +146,21 @@ kag_hybrid_executor: &kag_hybrid_executor_conf
144146
- *rc
145147
merger:
146148
type: kag_merger
147-
enable_summary: true
149+
enable_summary: true
148150

149151
kag_output_executor: &kag_output_executor_conf
150152
type: kag_output_executor
153+
llm_module: *chat_llm
151154

152155
kag_deduce_executor: &kag_deduce_executor_conf
153156
type: kag_deduce_executor
154-
157+
llm_module: *chat_llm
155158

156159
py_code_based_math_executor: &py_code_based_math_executor_conf
157160
type: py_code_based_math_executor
158161
llm: *chat_llm
159162

163+
160164
kag_solver_pipeline:
161165
type: kag_static_pipeline
162166
planner:
@@ -172,7 +176,7 @@ kag_solver_pipeline:
172176
- *kag_deduce_executor_conf
173177
- *kag_output_executor_conf
174178
generator:
175-
type: llm_generator
179+
type: llm_index_generator
176180
llm_client: *chat_llm
177181
generated_prompt:
178182
type: default_refer_generator_prompt

kag/examples/domain_kg/kag_config.yaml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ chain_vectorizer:
100100

101101
kg_cs: &kg_cs
102102
type: kg_cs_open_spg
103+
priority: 0
103104
path_select:
104105
type: exact_one_hop_select
105106
graph_api: *graph_api
@@ -111,6 +112,11 @@ kg_cs: &kg_cs
111112
recognition_threshold: 0.9
112113
exclude_types:
113114
- Chunk
115+
- AtomicQuery
116+
- KnowledgeUnit
117+
- Summary
118+
- Outline
119+
- Doc
114120

115121
kg_fr: &kg_fr
116122
type: kg_fr_open_spg
@@ -135,28 +141,24 @@ kg_fr: &kg_fr
135141
recognition_threshold: 0.8
136142
exclude_types:
137143
- Chunk
144+
- AtomicQuery
145+
- KnowledgeUnit
146+
- Summary
147+
- Outline
148+
- Doc
138149

139150
rc: &rc
140151
type: rc_open_spg
141152
vector_chunk_retriever:
142-
type: vector_chunk_retriever_legacy
153+
type: vector_chunk_retriever
143154
vectorize_model: *vectorize_model
155+
score_threshold: 0.65
144156
search_api: *search_api
145157
graph_api: *graph_api
146158
search_api: *search_api
147159
vectorize_model: *vectorize_model
148160
top_k: 20
149161

150-
kag_merger:
151-
type: kg_merger
152-
top_k: 20
153-
llm_module: *chat_llm
154-
summary_prompt:
155-
type: default_thought_then_answer
156-
vectorize_model: *vectorize_model
157-
graph_api: *graph_api
158-
search_api: *search_api
159-
160162
kag_hybrid_executor: &kag_hybrid_executor_conf
161163
type: kag_hybrid_retrieval_executor
162164
retrievers:
@@ -165,14 +167,15 @@ kag_hybrid_executor: &kag_hybrid_executor_conf
165167
- *rc
166168
merger:
167169
type: kag_merger
168-
enable_summary: true
170+
enable_summary: true
169171

170172
kag_output_executor: &kag_output_executor_conf
171173
type: kag_output_executor
174+
llm_module: *chat_llm
172175

173176
kag_deduce_executor: &kag_deduce_executor_conf
174177
type: kag_deduce_executor
175-
178+
llm_module: *chat_llm
176179

177180
py_code_based_math_executor: &py_code_based_math_executor_conf
178181
type: py_code_based_math_executor
@@ -193,7 +196,7 @@ kag_solver_pipeline:
193196
- *kag_deduce_executor_conf
194197
- *kag_output_executor_conf
195198
generator:
196-
type: llm_generator
199+
type: llm_index_generator
197200
llm_client: *chat_llm
198201
generated_prompt:
199202
type: default_refer_generator_prompt

kag/examples/example_config.yaml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ kag_builder_pipeline:
3838
chain:
3939
type: unstructured_builder_chain # kag.builder.default_chain.DefaultUnstructuredBuilderChain
4040
extractor:
41-
type: schema_free_extractor # kag.builder.component.extractor.schema_free_extractor.SchemaFreeExtractor
41+
type: knowledge_unit_extractor
4242
llm: *openie_llm
4343
ner_prompt:
44-
type: default_ner # kag.builder.prompt.default.ner.OpenIENERPrompt
45-
std_prompt:
46-
type: default_std # kag.builder.prompt.default.std.OpenIEEntitystandardizationdPrompt
44+
type: knowledge_unit_ner
4745
triple_prompt:
48-
type: default_triple # kag.builder.prompt.default.triple.OpenIETriplePrompt
46+
type: knowledge_unit_triple
47+
kn_prompt:
48+
type: knowledge_unit
4949
reader:
5050
type: dict_reader # kag.builder.component.reader.dict_reader.DictReader
5151
post_processor:
@@ -75,6 +75,7 @@ graph_api: &graph_api
7575

7676
kg_cs: &kg_cs
7777
type: kg_cs_open_spg
78+
priority: 0
7879
path_select:
7980
type: exact_one_hop_select
8081
graph_api: *graph_api
@@ -85,14 +86,19 @@ kg_cs: &kg_cs
8586
search_api: *search_api
8687
recognition_threshold: 0.9
8788
exclude_types:
88-
- "Chunk"
89+
- Chunk
90+
- AtomicQuery
91+
- KnowledgeUnit
92+
- Summary
93+
- Outline
94+
- Doc
8995

9096
kg_fr: &kg_fr
91-
type: kg_fr_open_spg
97+
type: kg_fr_knowledge_unit
9298
top_k: 20
9399
graph_api: *graph_api
94100
search_api: *search_api
95-
vectorize_model: *vectorize_model
101+
vectorize_model: *vectorize_model
96102
path_select:
97103
type: fuzzy_one_hop_select
98104
llm_client: *openie_llm
@@ -109,29 +115,25 @@ kg_fr: &kg_fr
109115
search_api: *search_api
110116
recognition_threshold: 0.8
111117
exclude_types:
112-
- "Chunk"
118+
- Chunk
119+
- AtomicQuery
120+
- KnowledgeUnit
121+
- Summary
122+
- Outline
123+
- Doc
113124

114125
rc: &rc
115126
type: rc_open_spg
116127
vector_chunk_retriever:
117-
type: vector_chunk_retriever_legacy
128+
type: vector_chunk_retriever
118129
vectorize_model: *vectorize_model
130+
score_threshold: 0.65
119131
search_api: *search_api
120132
graph_api: *graph_api
121133
search_api: *search_api
122134
vectorize_model: *vectorize_model
123135
top_k: 20
124136

125-
kag_merger:
126-
type: kg_merger
127-
top_k: 20
128-
llm_module: *chat_llm
129-
summary_prompt:
130-
type: default_thought_then_answer
131-
vectorize_model: *vectorize_model
132-
graph_api: *graph_api
133-
search_api: *search_api
134-
135137
kag_hybrid_executor: &kag_hybrid_executor_conf
136138
type: kag_hybrid_retrieval_executor
137139
retrievers:
@@ -142,13 +144,13 @@ kag_hybrid_executor: &kag_hybrid_executor_conf
142144
type: kag_merger
143145
enable_summary: true
144146

145-
146147
kag_output_executor: &kag_output_executor_conf
147148
type: kag_output_executor
149+
llm_module: *chat_llm
148150

149151
kag_deduce_executor: &kag_deduce_executor_conf
150152
type: kag_deduce_executor
151-
153+
llm_module: *chat_llm
152154

153155
py_code_based_math_executor: &py_code_based_math_executor_conf
154156
type: py_code_based_math_executor

0 commit comments

Comments
 (0)