生物医学命名为实体识别的西斯帕西(NER)

时间:2019-12-10 10:43:30

标签: python nlp bioinformatics ner

如何使用Scispacy标记实体?

当我尝试使用scispacy执行NER时,它通过将生物医学实体标记为Entity来识别生物医学实体,但未能将其标记为基因/蛋白质等。那么我该如何使用scispacy?还是scispacy无法标记数据?图像仅供参考: jupyter notebook snippet

2 个答案:

答案 0 :(得分:1)

模型en_core_sci_smen_core_sci_mden_core_sci_lg未命名其实体。如果您要标记实体,请使用模型

  • en_ner_craft_md
  • en_ner_jnlpba_md
  • en_ner_bc5cdr_md
  • en_ner_bionlp13cg_md

每个实体都有自己的实体类型,请参见:-

https://allenai.github.io/scispacy/

更多信息

答案 1 :(得分:0)

您可以通过'GENE_OR_GENE_PRODUCT'筛选标签以获取所有基因名称。

import spacy
import scispacy
import en_ner_bionlp13cg_md

document = "We aimed to prospectively compare the risk of early progression according to circulating ESR1 mutations, CA-15.3, and circulating cell-free DNA in MBC patients treated with a first-line aromatase inhibitor (AI)"

nlp = spacy.load("en_ner_bionlp13cg_md")
for X in nlp(document).ents:
    if X.label_=='GENE_OR_GENE_PRODUCT':
        print(X.text)