基本术语 NLP/logical 解析示例
Terms for basic NLP/logical parsing example
给定以下子句:
Female or not White
下面的树是正确的表示吗?
OR
/ \
female NOT white
也就是说,"not white"是一个单位还是两个?
另外,解析时通常调用以下四种元素是什么:
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?)
试试这个代码:
import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("Female or not White")
spacy.displacy.render(doc, style='dep')
输出:
因此在您的情况下,Not
将被视为反转
或者你可以参考这里进行句子解析-
给定以下子句:
Female or not White
下面的树是正确的表示吗?
OR
/ \
female NOT white
也就是说,"not white"是一个单位还是两个?
另外,解析时通常调用以下四种元素是什么:
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?)
试试这个代码:
import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("Female or not White")
spacy.displacy.render(doc, style='dep')
输出:
因此在您的情况下,Not
将被视为反转
或者你可以参考这里进行句子解析-