Skip to content

fix: replace deprecated grouped_entities with aggregation_strategy across all languages#1198

Open
ddarji1409 wants to merge 1 commit intohuggingface:mainfrom
ddarji1409:grouped-entities-deprecated
Open

fix: replace deprecated grouped_entities with aggregation_strategy across all languages#1198
ddarji1409 wants to merge 1 commit intohuggingface:mainfrom
ddarji1409:grouped-entities-deprecated

Conversation

@ddarji1409
Copy link
Copy Markdown

Summary

Fixes #44016 (reported in huggingface/transformers).

The grouped_entities parameter was removed from TokenClassificationPipeline. Passing it now raises:

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

The replacement is aggregation_strategy="simple" which provides equivalent behavior.

Changes

Replaced all occurrences of grouped_entities=True with aggregation_strategy="simple" across:

  • 35 files spanning 17 language chapters (en, de, es, fr, hi, it, ja, ko, my, pt, ro, ru, te, th, vi, zh-TW, zh-CN)
  • Covers .mdx chapter files and .md subtitle files
  • Handles edge cases: spaces around =, extra text in backticks, HTML <code> tags, glossary entries

Test

Running the updated notebook code no longer raises a TypeError and the NER pipeline runs correctly.

Related: huggingface/transformers#44016

🤖 Generated with Claude Code

The `grouped_entities=True` parameter was removed from `TokenClassificationPipeline`.
Replace all occurrences across all language chapters and subtitles with the
current equivalent: `aggregation_strategy="simple"`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Rocketknight1
Copy link
Copy Markdown
Member

hi @ddarji1409, it looks good but the PR build is failing! Can you check the CI to see if a syntax error was introduced anywhere?

{
text: "Er gibt Begriffe zurück, die für Personen, Organisationen oder Orte stehen.",
explain: "Außerdem werden mit <code>grouped_entities=True</code> die Wörter, die zur selben Entität gehören, gruppiert, wie z. B. \"Hugging Face\".",
explain: "Außerdem werden mit <code>aggregation_strategy="simple"</code> die Wörter, die zur selben Entität gehören, gruppiert, wie z. B. \"Hugging Face\".",
Copy link
Copy Markdown

@khushali9 khushali9 Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to take care of " double quatation around word simple like how it is for Hugging Face.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants