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

simplify transformer_token_classification_taskmodule #71

Merged
merged 11 commits into from
Feb 23, 2022

Conversation

ArneBinder
Copy link
Owner

No description provided.

single_sentence: bool = False,
sentence_annotation: str = "sentences",
partition_annotation: Optional[str] = None,
single_sentence: bool = False, # deprecated, set partition_annotation instead
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're still at version 0.x -- no need for backwards compatibility or deprecations, just remove it. 😃

Copy link
Owner Author

Choose a reason for hiding this comment

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

ok, nice :)

def _encode_text(self, text, partition: Optional[LabeledSpan] = None):
if self.partition_annotation is not None and partition is None:
raise ValueError(f"partitioning is enabled, but no partition is provided")
_text = text[partition.start : partition.end] if partition is not None else text
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we agree on not using underscores for variable names. I'm sure there is a name that fits better.

@ChristophAlt
Copy link
Collaborator

Looks good! 👍 The unittest cleanup will be done in a different commit.

@ChristophAlt ChristophAlt merged commit a83f179 into main Feb 23, 2022
@ArneBinder ArneBinder deleted the transformer_token_classification_refactor branch February 23, 2022 16:05
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.

2 participants