huggingface / huggingface/course
TypeError in NER Pipeline: grouped_entities is deprecated/removed in v5.0
- Dominant language
- MDX
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 13m
- Merged PRs (30d)
- 1
Description
### 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
- [x] The official example scripts
- [ ] My own modified scripts
### Tasks
- [x] 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
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.