- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 neuralcoref - 一个基于 spaCy 解析器的共指解析模块。 GIT https://github.com/huggingface/neuralcoref
但是,我得到的结果可以改进。 huggingface(neuralcoref 的开发者)提供的在线可视化工具为我提供了更准确的结果。
我正在分析的文本:"伦敦是英格兰和英国的首都和人口最多的城市。它位于大不列颠岛东南部的泰晤士河畔,两千年来一直是主要的定居点。"
我得到这个结果:
doc._.coref_resolved
London is the capital and most populous city of England and the United Kingdom. Standing on the River Thames in the south east of the island of Great Britain, the River Thames has been a major settlement for two millennia.
所以它错误地将伦敦与泰晤士河联系起来。 (它 -> 泰晤士河)
neuralcoref 在线可视化工具返回正确的链接(it -> London)
我已经尝试过调整参数,例如项目的 git 页面上提到的贪婪度、max_dist https://github.com/huggingface/neuralcoref
import spacy
nlp = spacy.load('en_core_web_lg')
import neuralcoref
neuralcoref.add_to_pipe(nlp,greedyness=0.5,store_scores=True)
text = "London is the capital and most populous city of England and the United Kingdom. Standing on the River Thames in the south east of the island of Great Britain, it has been a major settlement for two millennia."# It was founded by the Romans, who named it Londinium."
doc = nlp(text)
print(doc._.coref_resolved)
doc._.coref_scores
有没有办法调整它以获得与可视化工具类似的结果?
谢谢!
最佳答案
不知道为什么在线工具会更好用(在线可视化工具不适合我)。
你可以做的是添加一个对话库:
coref = neuralcoref.NeuralCoref(nlp.vocab, conv_dict={'London': ['city', 'settlement']})
https://reposhub.com/python/deep-learning/huggingface-neuralcoref.html
我有自己的问题,对荷兰语根本不起作用..
关于nlp - 如何调整 neuralcoref 以获得更好的共指结果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56710356/
我正在使用 neuralcoref - 一个基于 spaCy 解析器的共指解析模块。 GIT https://github.com/huggingface/neuralcoref 但是,我得到的结果可
我正在尝试安装 neuralcoref 并按照提供的说明进行操作 here . 我创建了一个 jupyter notebook 并尝试运行以下代码。 # Load your usual SpaCy m
我正在尝试在 colab 中使用以下 spacy 模块: https://spacy.io/universe/project/neuralcoref 我安装了以下软件包: !pip install s
我正在寻找一种适当的方法来查找我正在查看的某些文档中的共指实例中使用了特定代词的实例。一是我的内存力有问题,这让我觉得我没有以一种非常经济的方式来做这件事,但我也不确定我是否以正确的方式去做。这个想法
我是一名优秀的程序员,十分优秀!