blmoistawinde / HarvestText

文本挖掘和预处理工具(文本清洗、新词发现、情感分析、实体识别链接、关键词抽取、知识抽取、句法分析等),无监督或弱监督方法
MIT License
2.43k stars 330 forks source link

问答模块无法正常使用 #46

Open scalaKing opened 1 year ago

scalaKing commented 1 year ago

你好,我尝试使用您的问答模块跑demo,就是运行naiveKGQA.py这个Python脚本,结果直接报如下错误: 问:你好 答:你好 问:孙中山干了什么事? Traceback (most recent call last): File "D:\workspace\git\HarvestText\examples\naiveKGQA.py", line 165, in print("答:"+QA.answer(question0)) File "D:\workspace\git\HarvestText\examples\naiveKGQA.py", line 110, in answer answers = self.search_answers(search0) File "D:\workspace\git\HarvestText\examples\naiveKGQA.py", line 99, in search_answers records = self.KG.query(search0) File "D:\ProgramData\anaconda3\envs\kg_env\lib\site-packages\rdflib\graph.py", line 1127, in query result = plugin.get(result, query.Result) File "D:\ProgramData\anaconda3\envs\kg_env\lib\site-packages\rdflib\plugin.py", line 107, in get return p.getClass() File "D:\ProgramData\anaconda3\envs\kg_env\lib\site-packages\rdflib\plugin.py", line 69, in getClass module = import(self.module_path, globals(), locals(), [""]) File "D:\ProgramData\anaconda3\envs\kg_env\lib\site-packages\rdflib\plugins\sparql__init__.py", line 33, in from . import parser File "D:\ProgramData\anaconda3\envs\kg_env\lib\site-packages\rdflib\plugins\sparql\parser.py", line 184, in Param('prefix', PN_PREFIX)) + Suppress(':').leaveWhitespace() File "D:\ProgramData\anaconda3\envs\kg_env\lib\site-packages\rdflib\plugins\sparql\parserutils.py", line 114, in init self.name = name AttributeError: can't set attribute

操作系统:Win10 专业版

python版本:3.6.13

HarvestText版本:0.8.1.8