OpenSPG / openspg

OpenSPG is a Knowledge Graph Engine developed by Ant Group in collaboration with OpenKG, based on the SPG (Semantic-enhanced Programmable Graph) framework. Core Capabilities: 1) domain model constrained knowledge modeling, 2) facts and logic fused representation, 3) natively support KAG...
https://spg.openkg.cn/en-US
Apache License 2.0
808 stars 102 forks source link

医疗案例知识抽取任务Connection error #275

Closed zjuKcheng closed 5 months ago

zjuKcheng commented 6 months ago

执行knext builder execute Disease 报错: ERROR: REPrompt.init() missing 1 required positional argument: 'spg_type_name' 之后参考issue#236在openspg_venv下执行pip install openspg-knext -U 随后再次执行knext builder execute Disease 如下: (openspg_venv) root@kcheng-Vostro-3910-China-HDD-Protection:/code/python/knext/knext/examples/medicine# knext builder execute Disease 2024-06-06 07:01:26,174 [] [] [main] INFO c.a.o.c.i.g.GraphStoreClientDriverManager - registerDriver: com.antgroup.openspg.cloudext.impl.graphstore.tugraph.TuGraphStoreClientDriver@8297b3a 2024-06-06 07:01:26,175 [] [] [main] INFO c.a.o.c.u.DriverManagerUtils - DriverManager.initialize: cloudext.graphstore.drivers = null 2024-06-06 07:01:26,175 [] [] [main] INFO c.a.o.c.i.g.GraphStoreClientDriverManager - graph-store DriverManager initialized 2024-06-06 07:01:26,494 [] [] [main] INFO c.a.o.c.i.s.SearchEngineClientDriverManager - registerDriver: com.antgroup.openspg.cloudext.impl.searchengine.elasticsearch.ElasticSearchEngineClientDriver@3a0d172f 2024-06-06 07:01:26,494 [] [] [main] INFO c.a.o.c.u.DriverManagerUtils - DriverManager.initialize: cloudext.searchengine.drivers = null 2024-06-06 07:01:26,494 [] [] [main] INFO c.a.o.c.i.s.SearchEngineClientDriverManager - search-engine DriverManager initialized 2024-06-06 07:01:26,561 [] [] [main] INFO c.a.o.b.c.p.o.PythonOperatorFactory - pythonExec=/openspg_venv/bin/python3, pythonPaths=[/openspg_venv/bin, /usr/lib/python38.zip, /usr/lib/python3.8, /usr/lib/python3.8/lib-dynload, /openspg_venv/lib/python3.8/site-packages, /code/python/knext/knext/examples/medicine, /code/python/knext/knext/examples/medicine/builder/operator, /openspg_venv/lib/python3.8/site-packages/knext/builder/operator/builtin, /code/python/knext/knext/examples/medicine/builder/job] Connection error. Connection error. Connection error. 2024-06-06 07:02:19,939 [] [] [main] INFO c.a.o.b.r.l.r.BuilderMetric - type=COUNTER, name=default_job_error, count=0 (openspg_venv) root@kcheng-Vostro-3910-China-HDD-Protection:/code/python/knext/knext/examples/medicine# ^Cl, count=1, m1_rate=0.09447331054820299, m5_rate=0.17214159528501158, m15_rate=0.1902458849001428, mean_rate=0.018928065550953412, r(openspg_venv) root@kcheng-Vostro-3910-China-HDD-Protection:/code/python/knext/knext/examples/medicine#

openai_infer.json 中使用了sk开头的api key,在python环境中测试了key有效,openai_infer.json如下: { "nn_name": "gpt-3.5-turbo", "openai_api_key": $"OPENAI_KEY", "openai_api_base": "https://api.openai.com/v1", "openai_max_tokens": 1000 }

andylau-55 commented 5 months ago

请提供下当前环境的openspg-knext 和openspg-server的版本信息。需使用最新版本进行构建

zjuKcheng commented 5 months ago

重置了本地的openspg后之前的问题没有出现,出现了新的问题,在提交knext schema commit报错ERROR: type name: Medicine.Symptom not match project namespace: SupplyChain,

(openspg_venv) root@kcheng-Vostro-3910-China-HDD-Protection:/code/python/knext/knext/examples/medicine# knext schema commit Create type: Medicine.Symptom Create type: Medicine.Drug Create type: Medicine.Indicator Create type: Medicine.BodyPart Create type: Medicine.HospitalDepartment Create type: Medicine.Disease Create relation: [Medicine.Disease] abnormal ERROR: type name: Medicine.Symptom not match project namespace: SupplyChain

版本信息如下:

REPOSITORY TAG IMAGE ID CREATED SIZE alpine latest 1d34ffeaf190 3 weeks ago 7.79MB openspg/openspg-server latest acee60e5ee2b 7 weeks ago 860MB openspg/openspg-mysql latest 36c4b10b2a7c 7 weeks ago 407MB openspg/openspg-python latest eb8dd63ad296 7 weeks ago 1.16GB tugraph/tugraph-runtime-centos7 4.0.1 97cffe68d225 7 months ago 8.21GB elasticsearch 8.5.3 7eac6adf7120 18 months ago 1.29GB mariadb 10.5.8 ade39f0469a3 3 years ago 407MB

(openspg_venv) root@kcheng-Vostro-3910-China-HDD-Protection:/code/python/knext/knext/examples/medicine# knext project list ID Name Namespace Description
1 defaultProject DEFAULT defaultProject
2 RiskMining RiskMining RiskMining
3 SupplyChain SupplyChain SupplyChain
4 Medicine Medicine Medicine

(openspg_venv) root@kcheng-Vostro-3910-China-HDD-Protection:/code/python/knext/knext/examples/medicine# knext --version knext, version 0.0.3-beta2

andylau-55 commented 5 months ago

根据提示是当前目录的projectId和SupplyChain域的projectId冲突了,请检查执行目录下的.knext.cfg文件中的project_id、namespace是否和数据库中的一致。