-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
feat / parserFeature: Dependency ParserFeature: Dependency Parserperf / accuracyPerformance: accuracyPerformance: accuracy
Description
When using the dependency parser, it seems like there can be a lot of ambiguity when trying to assign negation, unlike with something like Stanford's parser.
For example:
import spacy
nlp = spacy.load("en_core_web_sm")
sentence = u"The camera is not pretty, but it is functional."
doc = nlp(sentence)
for token in doc:
print(token.dep_ + "(" + token.head.text + ", " + token.text + ")")
returns
det(camera, The)
nsubj(is, camera)
ROOT(is, is)
neg(is, not)
acomp(is, pretty)
punct(is, ,)
cc(is, but)
nsubj(is, it)
conj(is, is)
acomp(is, functional)
punct(is, .)
This output seems to imply that the negation could refer to either acomp
, which is not the case. A Stanford output for the same sentence looks something like:
det(camera-2, The-1)
nsubj(pretty-5, camera-2)
cop(pretty-5, is-3)
neg(pretty-5, not-4)
root(ROOT-0, pretty-5)
cc(pretty-5, but-7)
nsubj(functional-10, it-8)
cop(functional-10, is-9)
conj(pretty-5, functional-10)
Is there any way to clear up this ambiguity currently?
Your Environment
- Python Version Used: 2.7.14
- spaCy Version Used: 2.0.11
Metadata
Metadata
Assignees
Labels
feat / parserFeature: Dependency ParserFeature: Dependency Parserperf / accuracyPerformance: accuracyPerformance: accuracy