Automatic Speech Recognition
Transformers
PyTorch
TensorBoard
Chinese
whisper
whisper-event
Generated from Trainer
Eval Results (legacy)
Instructions to use thomas0104/whisper_medium_nan_tw with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thomas0104/whisper_medium_nan_tw with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="thomas0104/whisper_medium_nan_tw")# Load model directly from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq processor = AutoProcessor.from_pretrained("thomas0104/whisper_medium_nan_tw") model = AutoModelForSpeechSeq2Seq.from_pretrained("thomas0104/whisper_medium_nan_tw") - Notebooks
- Google Colab
- Kaggle
| import re | |
| import jiwer | |
| p = open('label.txt',encoding="utf-8") | |
| label = p.readline().split('=')[1] | |
| label = eval(label) | |
| label_ch = [] | |
| label_rm = [] | |
| for i in range(len(label)): | |
| q = re.search('[^A-z]+\s+', str(label[i])).span() | |
| label_ch.append(label[i][:q[1]]) | |
| label_rm.append(label[i][q[1]:]) | |
| p = open('pred.txt','r',encoding="utf-8") | |
| pred = p.readline().split('=')[1] | |
| pred = eval(pred) | |
| pred_ch = [] | |
| pred_rm = [] | |
| for i in range(len(pred)): | |
| q = re.search('[^A-z]+\s+', str(pred[i])).span() | |
| pred_ch.append(pred[i][:q[1]]) | |
| pred_rm.append(pred[i][q[1]:]) | |
| for i in range(len(label_rm)): | |
| if len(label_rm[i]) == 0: | |
| print(i) | |
| label_rm[i] = 'a' | |
| wer_ch = jiwer.wer(label_ch, pred_ch) | |
| print(f'{wer_ch=}') | |
| wer_rm = jiwer.wer(label_rm, pred_rm) | |
| print(f'{wer_rm=}') | |