简体   繁体   中英

Terms for basic NLP/logical parsing example

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?)

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: 在此处输入图片说明

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM