question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using 'ner' task in pipeline with a non default model gives me entities as "LABEL-6" , "LABEL-8" instead of "I-ORG" and "I-LOC"

See original GitHub issue

model - dbmdz/bert-base-cased-finetuned-conll03-english

Language - english

The problem arises when using:

  • my own modified scripts

The tasks I am working on is:

  • an official GLUE/SQUaD task: ner

To reproduce

tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-base-cased-finetuned-conll03-english")
model = AutoModelForTokenClassification.from_pretrained("dbmdz/bert-base-cased-finetuned-conll03-english")
ner_task = pipeline(task='ner', model=model, tokenizer=tokenizer)
ner_task('Hugging Face is a French company based in New-York.')

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
stefan-itcommented, Apr 29, 2020

Oh no, there’s something wrong with the label alignment (can also be seen in the config.json):

"id2label": {
    "0": "LABEL_0",
    "1": "LABEL_1",
    "2": "LABEL_2",
    "3": "LABEL_3",
    "4": "LABEL_4",
    "5": "LABEL_5",
    "6": "LABEL_6",
    "7": "LABEL_7",
    "8": "LABEL_8"
  },
  "initializer_range": 0.02,
  "intermediate_size": 3072,
  "label2id": {
    "LABEL_0": 0,
    "LABEL_1": 1,
    "LABEL_2": 2,
    "LABEL_3": 3,
    "LABEL_4": 4,
    "LABEL_5": 5,
    "LABEL_6": 6,
    "LABEL_7": 7,
    "LABEL_8": 8
  },

Thanks for reporting, I’ll try to fix it 😃

In the meantime, you could use our large model dbmdz/bert-large-cased-finetuned-conll03-english 😅

0reactions
stale[bot]commented, Nov 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to keep structure of text after feeding it to a pipeline for NER
Basically what I do is substituting the entities recognized with the entity tag, and leave the rest of the text as is. With...
Read more >
DotNetCoreCLI@2 - .NET Core v2 task - Microsoft Learn
Build, test, package, or publish a dotnet application, or run a custom dotnet command.
Read more >
Create a CI/CD pipeline for .NET with the DevOps Starter Project
What's covered in this lab? · Create an ASP.NET sample DevOps project using DevOps Starter feature in Azure · Examine the CI/CD pipelines...
Read more >
Creating a CI/CD pipeline with Azure Pipelines and Compute ...
This tutorial shows how to use Azure Pipelines to create a continuous integration/continuous deployment (CI/CD) pipeline for applications ...
Read more >
Apply Solution Upgrade in Pipeline
UPDATE (2021-04-02): For a few days there is a task in the Power Platform Build Tools to apply solution upgrades. As I mentioned...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found