bug(medcat): CU-869djf7qd Fix trainer detected name preprocessing#527
Merged
mart-r merged 4 commits intoJun 4, 2026
Merged
Conversation
adam-sutton-1992
approved these changes
Jun 4, 2026
Contributor
adam-sutton-1992
left a comment
There was a problem hiding this comment.
Yeah nice, lucky to find that issue.
mart-r
added a commit
that referenced
this pull request
Jun 4, 2026
* CU-869djf7qd: Fix issue with name preparation during supervised training * CU-869djf7qd: Add test for prepare_name call with tagger * CU-869djf7qd: Moved name preparation to its own method in trainer * CU-869djf7qd: Add more specific / targetted test for name trainer name processor --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the preprocessing of names during supervised training.
The issue was that for names which had tokens that would normally need to be skipped (e.g new lines) would not be skipped during the
prepare_namecall. That's because these skips are annotated in the tagger.E.g (in an example from Adam) the annotation for:
would previously be processed into:
This PR uses the
Pipeline.tokenizer_with_tagproperty instead of just the.tokenizer. The former is a tokenizer that also runs the tagger component.With this change, the same name is correctly processed to:
There are also a few tests to this effect.