ladderlore
လမ်းညွှန် တောင်းဆိုရန်
  • S3 သို့မဟုတ် IAM လို service အမည်ကို ရိုက်ထည့်ပါ။

သဘောတရား · AIF-C01 အပေါ် ဆက်လေ့လာရန်

NLP and text-generation metrics

BLEU, ROUGE, BERTScore, semantic similarity and perplexity: what each compares and which need a reference text.

ဒီသင်ခန်းစာကို မြန်မာဘာသာ မပြန်ရသေးလို့ အင်္ဂလိပ်လို ပြထားပါတယ်။

AI Practitioner မှ သင်သိပြီးသားများ

  • ROUGE fits summaries, BLEU fits translation and BERTScore compares meaning.
  • Perplexity needs no reference text, and lower is better.
AI Practitioner သင်ခန်းစာကို ဖတ်ရန်
  • BLEU

    It counts
    Output n-grams found in reference
    Fits
    Translation
    Reference?
    Needed
  • ROUGE-N

    It counts
    Reference n-grams found in output
    Fits
    Summaries
    Reference?
    Needed
  • ROUGE-L

    It counts
    Longest shared word sequence
    Fits
    Summaries
    Reference?
    Needed
  • BERTScore

    It counts
    Token embedding similarity
    Fits
    Any text, paraphrase
    Reference?
    Needed
  • Semantic similarity

    It counts
    Whole-text embedding similarity
    Fits
    Any text, paraphrase
    Reference?
    Needed
  • Perplexity

    It counts
    How well the model predicts text
    Fits
    Comparing language models
    Reference?
    Not needed
Which metric fits, and whether it needs a reference.

1 / 3

  • BLEU

    It counts
    Output n-grams found in reference
    Fits
    Translation
    Reference?
    Needed
  • ROUGE-N

    It counts
    Reference n-grams found in output
    Fits
    Summaries
    Reference?
    Needed

2 / 3

  • ROUGE-L

    It counts
    Longest shared word sequence
    Fits
    Summaries
    Reference?
    Needed
  • BERTScore

    It counts
    Token embedding similarity
    Fits
    Any text, paraphrase
    Reference?
    Needed

3 / 3

  • Semantic similarity

    It counts
    Whole-text embedding similarity
    Fits
    Any text, paraphrase
    Reference?
    Needed
  • Perplexity

    It counts
    How well the model predicts text
    Fits
    Comparing language models
    Reference?
    Not needed
Which metric fits, and whether it needs a reference.
Model output
Embedding model
Cosine similarity
Reference text
  1. 1Embed the model output.
  2. 2Embed the reference text.
  3. 3Compare the two vectors. Close to 1 means similar meaning.
Semantic similarity embeds both texts and compares the vectors.

ဘာလဲ

Most text metrics need a reference: a text a person wrote, which the output is compared with. Perplexity is the exception. None of these metrics judges facts, tone or helpfulness. Use a judge model or people for that.

ဘာလဲ

BLEU is precision-oriented. It counts how many n-grams (groups of 1 to 4 words) of the output also appear in the reference, with a brevity penalty for short outputs. It was made for translation. ROUGE is recall-oriented: how much of the reference shows up in the output. ROUGE-N counts overlapping n-grams (ROUGE-1 single words, ROUGE-2 word pairs). ROUGE-L uses the longest common subsequence, so it rewards the same words in the same order. ROUGE was made for summaries.

ဘာလဲ

Both reward matching words, so a good paraphrase scores low. BERTScore avoids that: it embeds each token with a BERT model, matches output and reference tokens by cosine similarity, and reports precision, recall and F1. Bedrock automatic evaluation uses BERTScore as the accuracy metric for summarization. Semantic similarity embeds the whole output and reference and takes the cosine similarity: near 1 means near in meaning. It is cheap and handles paraphrase, but can score high when one number or a “not” has changed.

ဘာလဲ

Perplexity measures how surprised a language model is by a text: lower means it predicts the text better. It needs no reference and compares language models on the same text, but says nothing about whether an answer is right.

မှတ်ထားရန်

  • BLEU: n-gram precision plus brevity penalty. ROUGE-N: n-gram recall. ROUGE-L: longest common subsequence.
  • BERTScore and semantic similarity credit paraphrase.
  • Reference needed: all except perplexity.

စာမေးပွဲမှာ

  • “Score a machine translation against human translations” points to BLEU.
  • “Compare a summary with a reference and respect word order” points to ROUGE-L.
  • “A paraphrase should still score well” points to BERTScore or semantic similarity.
  • “Evaluate a language model with no reference answers” points to perplexity.