Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

NER component in en_core_web_trf doesn't depend on transformer #13325

Closed
frankier opened this issue Feb 13, 2024 · 1 comment
Closed

NER component in en_core_web_trf doesn't depend on transformer #13325

frankier opened this issue Feb 13, 2024 · 1 comment

Comments

@frankier
Copy link

How to reproduce the behaviour

I just wanted entities so I thought I would only enable NER in case it goes a bit faster.

import spacy
nlp = spacy.load("en_core_web_trf", enable=["ner"])
results = nlp("I went to France for a coffee with Francois")
for ent in results.ents:
    print(ent.text, ent.label_)

It looks like the outputs are just that subsequent bigrams is ORDINAL:

I went ORDINAL
to France ORDINAL
for a ORDINAL
coffee with ORDINAL

The problem goes away when I enable transformer:

import spacy
nlp = spacy.load("en_core_web_trf", enable=["ner", "transformer"])
results = nlp("I went to France for a coffee with Francois")
for ent in results.ents:
    print(ent.text, ent.label_)

Output:

France GPE
Francois PERSON

I suppose ner should depend upon transformer.

Your Environment

  • Operating System: Linux
  • Python Version Used: 3.11.7
  • spaCy Version Used: 3.7.2
  • Environment Information:
@svlandeg
Copy link
Member

Hi! Let me transfer this thread to the discussion forum and follow up there.

@explosion explosion locked and limited conversation to collaborators Feb 14, 2024
@svlandeg svlandeg converted this issue into discussion #13328 Feb 14, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants