Skip to content

TypeError in NER Pipeline: grouped_entities is deprecated/removed in v5.0 #1208

@VishwaVikas20

Description

@VishwaVikas20

System Info

I encountered a TypeError when following a tutorial for the NER pipeline. It seems that the grouped_entities parameter, which was previously deprecated, has now been fully removed in the current version of transformers

This is the given code (https://huggingface.co/learn/llm-course/chapter1/3) in NER section

from transformers import pipeline
ner_pipeline = pipeline("ner", grouped_entities=True)

TypeError: TokenClassificationPipeline._sanitize_parameters() got an unexpected keyword argument 'grouped_entities'

This one is working:

from transformers import pipeline
ner_pipeline = pipeline("ner", aggregation_strategy="simple")

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

In this website https://huggingface.co/learn/llm-course/chapter1/3 under Named entity recognition section
This code is given as an example. This rises (TypeError: TokenClassificationPipeline._sanitize_parameters() got an unexpected keyword argument 'grouped_entities')

from transformers import pipeline
ner = pipeline("ner", grouped_entities=True)
ner("My name is Sylvain and I work at Hugging Face in Brooklyn.")

Expected behavior

from transformers import pipeline
ner_pipeline = pipeline("ner", grouped_entities=True)

from transformers import pipeline
ner_pipeline = pipeline("ner", aggregation_strategy="simple")

grouped_entities should be changed to aggregation_strategy

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions