Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous dependency parsing for negation #2277

Closed
mbrine555 opened this issue May 1, 2018 · 5 comments
Closed

Ambiguous dependency parsing for negation #2277

mbrine555 opened this issue May 1, 2018 · 5 comments
Labels
feat / parser Feature: Dependency Parser perf / accuracy Performance: accuracy

Comments

@mbrine555
Copy link

mbrine555 commented May 1, 2018

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
@honnibal
Copy link
Member

honnibal commented May 1, 2018

@mbrine555 Which Stanford dependency scheme is that?

@mbrine555
Copy link
Author

@honnibal Sorry, I should've been more clear. It's the Universal Dependency scheme used in Stanford's CoreNLP 3.9.1.

@dxiao2003
Copy link

If you run the visualizer you can see that the "not" refers specifically to the first "is" token. Not exactly the same parse as Stanford but at least it's not ambiguous as to which "is" it's referring to.

@ines ines added the feat / parser Feature: Dependency Parser label Jul 6, 2018
@ines ines added perf / accuracy Performance: accuracy and removed performance labels Aug 15, 2018
@ines
Copy link
Member

ines commented Dec 14, 2018

Merging this with #3052. We've now added a master thread for incorrect predictions and related reports – see the issue for more details.

@ines ines closed this as completed Dec 14, 2018
@lock
Copy link

lock bot commented Jan 13, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat / parser Feature: Dependency Parser perf / accuracy Performance: accuracy
Projects
None yet
Development

No branches or pull requests

4 participants