[英]Move spacy NER entity labels to top or bottom
I am using a spacy visualizer to show labels of each span.我正在使用 spacy visualizer 来显示每个跨度的标签。 I am trying to put the NER labels to the top or bottom of the text for better visualization and comparison.
我试图将 NER 标签放在文本的顶部或底部,以便更好地可视化和比较。 At the moment, I can visualize them with:
目前,我可以通过以下方式想象它们:
nlp=spacy.load("en_core_web_sm")
doc = nlp("This is from Texas Written by Ryan on sunday")
displacy.render(doc,style="ent",jupyter=True)
How can I move these entity labels to the top or bottom or left of the span?如何将这些实体标签移动到跨度的顶部、底部或左侧?
The documentation on setting options is here ;有关设置选项的文档在这里; there is no explanation on how to do this.
没有关于如何做到这一点的解释。
You can not do it using options but if you want to do it any way then clone Spacy from here and go to this file .您不能使用选项来完成此操作,但如果您想以任何方式执行此操作,请从此处将 Spacy 和 go 克隆到此文件。 There is one function
render_ents
There is HTML Formatting of Renderer there make changes in that Function and Build to test.有一个 function
render_ents
有 HTML 渲染器格式 Function 和 Build 进行更改以进行测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.