Skip to content

fix(ch6. unigram): probability calculations in Unigram tokenization chapter#1157

Open
carlyou wants to merge 1 commit intohuggingface:mainfrom
carlyou:fix-unigram-probabilities
Open

fix(ch6. unigram): probability calculations in Unigram tokenization chapter#1157
carlyou wants to merge 1 commit intohuggingface:mainfrom
carlyou:fix-unigram-probabilities

Conversation

@carlyou
Copy link

@carlyou carlyou commented Jan 4, 2026

Corrected three related errors in the probability calculations for the word "pug":

  1. Fixed P(["p","u","g"]) to use correct frequency 17/210 instead of 5/210
  2. Fixed P(["pu","g"]) to use correct frequency 17/210 instead of 5/210
  3. Updated tokenization probabilities table with correct values

The errors stemmed from using frequency 5 (for tokens like "s", "gs", "ugs") instead of the correct frequency 17 for "p" and "pu" as shown in the frequency table.

🤖 Generated with Claude Code

Corrected three related errors in the probability calculations for the word "pug":
1. Fixed P(["p","u","g"]) to use correct frequency 17/210 instead of 5/210
2. Fixed P(["pu","g"]) to use correct frequency 17/210 instead of 5/210
3. Updated tokenization probabilities table with correct values

The errors stemmed from using frequency 5 (for tokens like "s", "gs", "ugs")
instead of the correct frequency 17 for "p" and "pu" as shown in the frequency table.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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

Comments