-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
作为一个其他专业的小白,花了不少精力才复现了这个程序,在此简单分享下复现过程吧,免得大家踩同样的坑:
-
1.IDE用pycharm要比vscode强:vscode会报很多我解决不了的错,换了pychrm就好了;
-
2.依赖包按作者的requestment.txt安装,但是不要>=,就取==;(py2neo可能会有些问题,但安装也无妨,不妨碍大多数功能实现)
-
3.neo4j,按作者readme导入数据,一切正常;(至此应该可以实现实体识别、实体查询、关系查询、农业知识概览、农知问答功能)
-
4.tagging功能:需要安装mongodb,导入作者指定的数据json,这个过程会报数据读取不了的错误,需要改一下encoding,总之就是改一下数据的编码,数据导入正确了tagging功能就能正常用了
-
5.tagging-get有问题:这个功能没复现成功,问题出在从neo4j返回的数据没有被解析出来,我怀疑是不是py2neo的版本问题造成的,但是又没有找到3.0版本的py2neo
报错的位置在
Agriculture_KnowledgeGraph-master\demo\demo\tagging_data_view.py in showtagging_data
代码位置在
` answer=answer[0]
print(answer)
if answer == None:
ctx['title'] = ‘‘<h1> 该url不存在,别乱搞! </h1>’‘
return render(request, "tagging_data.html", ctx)
ctx['detail'] = answer['detail']
ctx['title'] = answer['title']
image = answer['image']
ctx['image'] = ''<img class="rounded card-img-top img-fluid" src="' + str(image) + '" alt="该条目无图片" style="width:30%" >''
ctx['baseInfoKeyList'] = []`
其中
`ctx['detail'] = answer['detail']
ctx['title'] = answer['title']
`
answer['detail']、answer['detail'],这种方式无法解析出answer内的detail,目前没找到解决方法,若是有大佬看到,还请指点一二。感激不尽
Metadata
Metadata
Assignees
Labels
No labels