简体   繁体   English

将 spacy NER 实体标签移动到顶部或底部

[英]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)

as:作为: 在此处输入图像描述

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.

相关问题 在spacy训练数据中基于NER实体标签过滤数据 - Filtering data based on NER entity labels in spacy training data 在 spacy 中使用 POS 和 NER 进行实体提取 - Entity extraction using POS and NER in spacy Spacy NER将实体分为两个单独的实体 - Spacy NER splitting the entity into two separate entities 将 Spacy NER 实体格式转换为 CONLL 格式 - Converting Spacy NER entity format to CONLL format 是否可以在 spaCy 的实体链接候选生成中使用 NER-Label? - Is it possible to use NER-Label in Entity Linking candidate generation in spaCy? spaCy 的 NER 有没有办法计算每个实体类型的指标? - is there a way with spaCy's NER to calculate metrics per entity type? 如何从 Spacy NER 模型中获得每个实体的预测概率? - How to get probability of prediction per entity from Spacy NER model? 对于 spacy 的 NER,我是否需要将整个单词 label 作为一个实体? - For spacy's NER, do I need to label the entire word as an entity? 使用实体标尺和 ner 管道加载预训练的自定义 model 时出现空间错误 - Spacy error in loading pretrained custom model with entity rulers and ner pipeline spacy如何使用单词嵌入进行命名实体识别(NER)? - How does spacy use word embeddings for Named Entity Recognition (NER)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM