Reputation: 110432
Given the following clause:
Female or not White
Is the following tree the correct representation of this?
OR
/ \
female NOT white
That is, would "not white" be one unit, or is it considered two?
Additionally, what are the following four elements usually called in parsing:
OR -- (logical?)
female -- (variable name?)
NOT -- (inversion? or is this also logical?)
TRUE -- (for example, whether the value of female is true or not -- variable value?)
Upvotes: 1
Views: 94
Reputation: 814
Try this code:
import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("Female or not White")
spacy.displacy.render(doc, style='dep')
So in your case, Not
will be considered as inversion
Or you can refer here for sentence parsing- how to get parse tree using python nltk?
Upvotes: 2