I want to find predicate and subject from a sentence using Natural Language Processing Libraries
. Is this technique have any name in the world of NLP
or Is there any way to do that?
Example : He likes child. Result: (He, likes child)
I want to find predicate and subject from a sentence using Natural Language Processing Libraries
. Is this technique have any name in the world of NLP
or Is there any way to do that?
Example : He likes child. Result: (He, likes child)
Yes you can do that with Word Dependency Parsing which is available in spaCy NLP. Here is the visualization using spaCy displaCy:
from that visualization, you can extract the word "He" as subject since its dependency property is "nsubj" or "normal subject", the word "likes" is predicate since its dependency property is "root" that means no dependency to other word in the sentence, and the word "childs" as an object since its dependency property is "dobj" or direct object.
The task you described is information extraction. Check the Wikipedia article or the Stanford open information extraction software
© 2022 - 2024 — McMap. All rights reserved.
Dependency parser Tree
? – Scheider