找到与主题对应的形容词-Python NLP
有没有一种有效的方法可以找到与主语相对应的形容词找到与主题对应的形容词-Python NLP,python,nlp,Python,Nlp,有没有一种有效的方法可以找到与主语相对应的形容词 def find_ADJ(NOUN, sentence): return (NOUN, ADJ) sentence = "I have a blue car that was a gift from my wife who is beautiful" INPUT: find_ADJ(car,sentence) OUTPUT: (car, blue) INPUT: find_ADJ(wife,sentenc
def find_ADJ(NOUN, sentence):
return (NOUN, ADJ)
sentence = "I have a blue car that was a gift from my wife who is beautiful"
INPUT: find_ADJ(car,sentence)
OUTPUT: (car, blue)
INPUT: find_ADJ(wife,sentence)
OUTPUT: (wife, beautiful)
*或者返回多个形容词
我试着用Spacy(pos_uu和dep_uu)做一些事情,但没有结果。有人知道我要找的图书馆或方法吗?
谢谢你你可以试试corefrence解析库,比如斯坦福大学的corenlp或huggingface。我知道huggingface会显示相关单词 演示: