ignite icon indicating copy to clipboard operation
ignite copied to clipboard

feat(metrics): add Character Error Rate (CER) metric

Open Manimaran-tech opened this issue 8 months ago • 2 comments

Description

This PR adds a new NLP metric, CharacterErrorRate, to Ignite.

Character Error Rate (CER) measures the normalized edit distance between predicted and reference strings at the character level.

What’s included

  • Adds CharacterErrorRate metric implementation
  • Uses Levenshtein edit distance to compute character-level errors
  • Supports batch-wise updates and distributed usage
  • Follows Ignite metric API conventions used by existing NLP metrics

Why

CER is a standard evaluation metric for ASR/OCR and other sequence-to-text tasks where character-level accuracy is important.

Fixes #{issue_number}

Checklist

  • [x] New tests are added (if a new feature is added)
  • [x] New docstrings are added and in RST format
  • [x] Documentation is updated (if required)

Manimaran-tech avatar Apr 01 '26 12:04 Manimaran-tech

@Manimaran-tech, could you link the issue number for this PR , also the Empty reference strings aren't handled in update and Distributed integration tests are missing as the other metric bleu and rogue have this

aniketpandey05 avatar Apr 02 '26 14:04 aniketpandey05

@vfdev-5 should i update the pr or this one is good to be merged?

aniketpandey05 avatar Apr 18 '26 13:04 aniketpandey05