Skip to content
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

Modify group_sub_entities in TokenClassification Pipeline to support label with "-" #27325

Merged
merged 2 commits into from
Nov 27, 2023

Conversation

eshoyuan
Copy link
Contributor

@eshoyuan eshoyuan commented Nov 6, 2023

What does this PR do?

This PR provides a bug fix for the group_sub_entities function within the NER pipeline. Previously, the function split entities on every dash (-), which led to incorrect parsing of entities that inherently contain a dash in their names. The code change ensures that only the first dash is considered for splitting, preserving the integrity of the entity names.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@eshoyuan eshoyuan changed the title Modify group_sub_entities in TokenClassification Pipeline to support label with Modify group_sub_entities in TokenClassification Pipeline to support label with "-" Nov 6, 2023
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Contributor

@Narsil Narsil left a comment

Choose a reason for hiding this comment

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

LGTM.

@amyeroberts for core maintainer's opinion

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

LGTM too - thanks for adapting!

@amyeroberts amyeroberts merged commit 334a6d1 into huggingface:main Nov 27, 2023
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.

4 participants