NLP - 识别哪个形容词描述句子中的哪个名词
NLP - identifying which adjective describes which noun in a sentence
我需要一种方法/算法来识别句子中哪个形容词与哪个名词相关。
示例输入:
"The product itself is good however this company has a terrible service"
作为输出,我想得到类似的东西:
[product, good]
[service, terrible]
能否请您指出一些有助于完成此类任务的算法/库?
您可以使用 Stanford dependency parser, also this 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)
我需要一种方法/算法来识别句子中哪个形容词与哪个名词相关。
示例输入:
"The product itself is good however this company has a terrible service"
作为输出,我想得到类似的东西:
[product, good]
[service, terrible]
能否请您指出一些有助于完成此类任务的算法/库?
您可以使用 Stanford dependency parser, also this 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)