简体   繁体   English

基本 NLP/逻辑解析示例的术语

[英]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所以在你的情况下, Not将被视为反转

Or you can refer here for sentence parsing- how to get parse tree using python nltk?或者你可以参考这里的句子解析- 如何使用python nltk获取解析树?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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