Skip to content

Remove punctuation in ApplyCustomWordEmbedding sample so "product" matches - #7961

Merged
vejbomar merged 1 commit into
mainfrom
vejbomar-fix-6078-custom-word-embedding-sample
Nov 27, 2026
Merged

vejbomar merged 1 commit into
mainfrom
vejbomar-fix-6078-custom-word-embedding-sample

Conversation

@vejbomar

Copy link
Copy Markdown
Contributor

NormalizeText keeps punctuation by default, so "product." in the sample input was tokenized with a trailing period and missed the "product" entry in the custom embedding model. Pass keepPunctuations: false to NormalizeText and update the expected output comment to reflect all four matched words.

Fixes #6078

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@vejbomar vejbomar changed the title Remove punctuation in custom word embedding sample so "product" matches Remove punctuation in ApplyCustomWordEmbedding sample so "product" token matches Nov 26, 2026
@vejbomar vejbomar changed the title Remove punctuation in ApplyCustomWordEmbedding sample so "product" token matches Remove punctuation in ApplyCustomWordEmbedding sample so "product" matches Nov 26, 2026
@vejbomar
vejbomar requested a balanced review from Copilot November 26, 2026 18:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the sample’s punctuation-normalization and expected-output updates.

No open issues 🎉

What changed in this PR

Fixes ML.NET’s custom word embedding sample so "product." matches the "product" model entry, addressing #6078 without changing library behavior.

Changes:

  • Disables punctuation retention before tokenization.
  • Updates the expected-output comment to reflect all four matched words.
File Description
docs/​samples/​Microsoft.ML.Samples/​Dynamic/​Transforms/​Text/​ApplyCustomWordEmbedding.cs Removes punctuation during normalization and corrects the documented feature values.

Review effort: Balanced

@vejbomar
vejbomar merged commit 98148ef into main Nov 27, 2026
8 checks passed
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.

The example ApplyCustomWordEmbedding is not correct, "product" is not found.

3 participants