请看一下这个箱子。 我想用Spacy、NLP和Python从这句话中提取意图
noun -> gaming
adj -> super perfect
noun -> everyday use
adj -> super perfect
这句话的信息
this is super perfect for gaming and everyday use
this (DET) nsubj is
is (AUX) ROOT is
super (ADV) advmod perfect
perfect (ADJ) acomp is
for (ADP) prep perfect
gaming (NOUN) pobj for
and (CCONJ) cc gaming
everyday (ADJ) advmod use
use (NOUN) conj gaming
我试过了
noun= "NOUN"
adj = "ADJ"
for token in doc:
add_neg_pfx = False
if(token.dep_ == "pobj"):
noun+= token.text
if(token.dep_ == "prep"):
adj += token.head.text
但这段代码似乎没有那么具体
目前没有回答
相关问题 更多 >
编程相关推荐