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

Noun chunking inconsistency #2053

Closed
johnnyleitrim opened this issue Mar 3, 2018 · 2 comments
Closed

Noun chunking inconsistency #2053

johnnyleitrim opened this issue Mar 3, 2018 · 2 comments
Labels
lang / en English language data and models perf / accuracy Performance: accuracy

Comments

@johnnyleitrim
Copy link

Doc.noun_chunks()is sometimes handing me back shorter noun chunks than I would have expected.

For example, in the code below, kobe bryant is sometimes split across noun chunks:

Example

import en_core_web_lg

nlp = en_core_web_lg.load()
sent = u'''Add kobe bryant shoes to my cart'''.strip()
tokens = nlp(sent)
print(sent)
for chunk in tokens.noun_chunks:
    print("\t{}".format(chunk.orth_))

sent = u'''Add kobe beef and kobe bryant shoes to my cart'''.strip()
tokens = nlp(sent)
print(sent)
for chunk in tokens.noun_chunks:
    print("\t{}".format(chunk.orth_))

Output

Add kobe bryant shoes to my cart
    kobe bryant shoes
    my cart
Add kobe beef and kobe bryant shoes to my cart
    kobe beef
    kobe
    bryant shoes
    my cart

In the second example, I would not have expected kobe and bryant shoes to be split across noun chunks, given that they were not split in the first example.

Environment

  • spaCy version: 2.0.5
  • Python version: 3.5.1
  • Models: en_core_web_lg
  • Platform: Darwin-17.4.0-x86_64-i386-64bit
@ines ines added the lang / en English language data and models label Apr 29, 2018
@ines ines added perf / accuracy Performance: accuracy and removed performance labels Aug 15, 2018
@ines
Copy link
Member

ines commented Dec 14, 2018

The noun chunks depend on the part-of-speech tags and dependency parse, so this issue likely comes down to incorrect predictions made by the tagger or parser.

I'm 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
lang / en English language data and models perf / accuracy Performance: accuracy
Projects
None yet
Development

No branches or pull requests

3 participants