【问题标题】:NLP - identifying which adjective describes which noun in a sentenceNLP - 识别哪个形容词描述了句子中的哪个名词
【发布时间】:2017-03-11 23:04:50
【问题描述】:

我需要一种方法/算法来识别句子中哪个形容词与哪个名词相关。

示例输入:

"The product itself is good however this company has a terrible service"

作为输出,我想得到类似的东西:

[product, good]
[service, terrible]

能否请您指出一些有助于完成此类任务的算法/库?

【问题讨论】:

    标签: nlp text-mining data-science


    【解决方案1】:

    您可以使用Stanford dependency parser,也可以使用此relevant paper。您也可以查看他们的在线工具。例如,对于您的句子,您可以从斯坦福解析器获得以下内容。

    您的查询

    The product itself is good however this company has a terrible service.
    

    标记

    The/DT product/NN itself/PRP is/VBZ good/JJ however/RB this/DT company/NN has/VBZ a/DT terrible/JJ service/NN ./.
    

    解析

    (ROOT
      (S
        (NP (DT The) (NN product))
        (ADVP (PRP itself))
        (VP (VBZ is)
          (ADJP (JJ good))
          (SBAR
            (WHADVP (RB however))
            (S
              (NP (DT this) (NN company))
              (VP (VBZ has)
                (NP (DT a) (JJ terrible) (NN service))))))
        (. .)))
    

    通用依赖

    det(product-2, The-1)
    nsubj(good-5, product-2)
    advmod(good-5, itself-3)
    cop(good-5, is-4)
    root(ROOT-0, good-5)
    advmod(has-9, however-6)
    det(company-8, this-7)
    nsubj(has-9, company-8)
    dep(good-5, has-9)
    det(service-12, a-10)
    amod(service-12, terrible-11)
    dobj(has-9, service-12)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-21
      • 2018-10-16
      • 2010-10-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多