1

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?)
David542
  • 104,438
  • 178
  • 489
  • 842

1 Answers1

2

Try this code:

import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("Female or not White")
spacy.displacy.render(doc, style='dep')

Output: enter image description here

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?

Community
  • 1
  • 1
Shadab Hussain
  • 794
  • 6
  • 24