Using Python Spacy, how to extract entity from simple passive voice sentence? In the follow sentence, my intention is to extract both "John” from the sentence as nsubjpass and .ent_.
sentence = "John was accused of crimes by David"
Using Python Spacy, how to extract entity from simple passive voice sentence? In the follow sentence, my intention is to extract both "John” from the sentence as nsubjpass and .ent_.
sentence = "John was accused of crimes by David"
Copyright © 2021 Jogjafile Inc.
I am answering to my question because I will ask question on complex sentences later on so that someone can review the answer to the simple sentence and then help me to answer on the complex sentences.
code
Result:
[John]