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

Handle NER usecase #263

Merged
merged 4 commits into from
Aug 29, 2023
Merged

Handle NER usecase #263

merged 4 commits into from
Aug 29, 2023

Conversation

Dref360
Copy link
Member

@Dref360 Dref360 commented Jun 15, 2023

Slight modification to handle NER.

NER pipeline outputs [?, Sequence, NClass], but we expect [?, NClass, Sequence]. So I changed that in predict_on_dataset_generator.

@Dref360 Dref360 marked this pull request as ready for review July 17, 2023 14:51
@Dref360 Dref360 requested a review from parmidaatg July 17, 2023 14:51
@@ -79,7 +79,7 @@ def predict_on_dataset_generator(
)

out = map_on_tensor(lambda o: o.view([iterations, -1, *o.size()[1:]]), out)
out = map_on_tensor(lambda o: o.permute(1, 2, *range(3, o.ndimension()), 0), out)
out = map_on_tensor(lambda o: o.permute(1, *range(3, o.ndimension()), 2, 0), out)
Copy link
Member Author

Choose a reason for hiding this comment

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

This also makes the result actually match the documentation

@Dref360 Dref360 merged commit da99ee3 into master Aug 29, 2023
2 checks passed
@Dref360 Dref360 deleted the feat/handle_ner branch August 29, 2023 01:20
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.

1 participant