【问题标题】:Python: pos tag - with word 'back'Python:pos标签-带有单词'back'
【发布时间】:2019-02-25 16:27:21
【问题描述】:

如何区分后面句子中的post标签:

  1. 在碰撞后她的下背部出现间歇性射击疼痛
  2. 在我脑后的某个地方

spacy 的例子

doc = nlp(u'experiencing intermittent shooting pain in her lower back following the collision')

for token in doc:
    print(token.text, token.pos_, token.tag_, token.dep_)

#experiencing VERB VBG ROOT
#intermittent ADJ JJ amod
#shooting NOUN NN compound
#pain NOUN NN dobj
#in ADP IN prep
#her ADJ PRP$ poss
#lower ADJ JJR advmod
#back ADV RB pobj
#following VERB VBG prep
#the DET DT det
#collision NOUN NN pobj

doc = nlp(u'somewhere in the back of my head')

for token in doc:
    print(token.text, token.pos_, token.tag_, token.dep_)

#somewhere ADV RB ROOT
#in ADP IN prep
#the DET DT det
#back NOUN NN pobj
#of ADP IN prep
#my ADJ PRP$ poss
#head NOUN NN pobj

直观地说,1中的'back'是名词,2是ADV?从上面的句子中提取名词时,我期望将“her lower back”中的“back”提取出来。那么,如何实现呢?

另外,对 pos 标记结果感到困惑,如何知道 pos 标记是否正常工作?

【问题讨论】:

    标签: python spacy pos-tagger


    【解决方案1】:

    后标记结果可能会令人困惑。

    一件事可能会帮助您理解名词块。或者制定获取自定义块的规则:通常从数据中识别出三元组和二元组的 pos-tags,然后使用这些块的 pos 标记来标记块中的单词。

    【讨论】:

      猜你喜欢
      • 2015-03-28
      • 2022-01-26
      • 1970-01-01
      • 2018-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-28
      • 1970-01-01
      相关资源
      最近更新 更多