-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create per.py #7538
Create per.py #7538
Conversation
And we have a package for ASR-related metrics. Why not move the metric there? |
move it from |
@jubick1337 @karpnv because this metric is applicable for ASR and NLP PC models both (there is noticed in the paper that PER allows to compare prediction accuracy between PC models in general) |
Note that coneptually this implementation of PER will give "useful" results only for NLP, where the input is the text that is to be punctuated and is immutable (i.e. the reference is this same text punctuated by hand; a clear ground truth to compare against). For the ASR case, eg. with hybrid_pc models, the input is audio, and the reference is the punctuated transcription (typically obtained by hand). If recognition is flawless then PER will give the correct information (the quality of the punctuation subtask), if recognition is not flawless punctuation might be affected by WER, and PER might be affected as well (eg. a word that is typically followed by a comma gets deleted). In certain occasions the punctuation of a imperfect transcription might still be flawless from the standpoint of punctuation, but since the metric is computed agains the original reference punctuated transcription, the PER score will be affected as well. There is no simple solution to this except to manually re-punctuate the transcription obtained by the ASR task and use that as reference, which might not be viable, but is something to keep in mind when reporting or. using the PER metric. |
Could you please add tests for PER here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor format changes, otherwise looks good to me
@jubick1337, I've added tests, could you please review them again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets move rate_punctuation.py to
https://github.com/NVIDIA/NeMo/blob/main/examples/asr/speech_to_text_eval.py by adding use_per=False option.
This type of modification will result in a reduction of certain features. For instance, in the It may be advisable to consider adding a feature to |
Script for calculation Punctuation Error Rate and related rates (correct rate, deletions rate, etc.)
@karpnv @ekmb @vsl9 @KunalDhawan