ydshieh HF staff commited on
Commit
06c0df4
1 Parent(s): ef8e371

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -2
README.md CHANGED
@@ -74,7 +74,10 @@ The model can be evaluated as follows on the zh-CN test data of Common Voice.
74
  Original CER calculation refer to https://huggingface.co/ctl/wav2vec2-large-xlsr-cantonese
75
 
76
  ```python
77
- # pip install jiwer
 
 
 
78
 
79
  import torch
80
  import torchaudio
@@ -114,7 +117,7 @@ processor = Wav2Vec2Processor.from_pretrained("ydshieh/wav2vec2-large-xlsr-53-ch
114
  model = Wav2Vec2ForCTC.from_pretrained("ydshieh/wav2vec2-large-xlsr-53-chinese-zh-cn-gpt")
115
  model.to("cuda")
116
 
117
- chars_to_ignore_regex = '[\\\\\\\\,\\\\\\\\?\\\\\\\\.\\\\\\\\!\\\\\\\\-\\\\\\\\;\\\\\\\\:"\\\\\\\\“\\\\\\\\%\\\\\\\\‘\\\\\\\\”\\\\\\\\�\\\\\\\\.\\\\\\\\⋯\\\\\\\\!\\\\\\\\-\\\\\\\\:\\\\\\\\–\\\\\\\\。\\\\\\\\》\\\\\\\\,\\\\\\\\)\\\\\\\\,\\\\\\\\?\\\\\\\\;\\\\\\\\~\\\\\\\\~\\\\\\\\…\\\\\\\\︰\\\\\\\\,\\\\\\\\(\\\\\\\\」\\\\\\\\‧\\\\\\\\《\\\\\\\\﹔\\\\\\\\、\\\\\\\\—\\\\\\\\/\\\\\\\\,\\\\\\\\「\\\\\\\\﹖\\\\\\\\·\\\\\\\\×\\\\\\\\̃\\\\\\\\̌\\\\\\\\ε\\\\\\\\λ\\\\\\\\μ\\\\\\\\и\\\\\\\\т\\\\\\\\─\\\\\\\\□\\\\\\\\〈\\\\\\\\〉\\\\\\\\『\\\\\\\\』\\\\\\\\ア\\\\\\\\オ\\\\\\\\カ\\\\\\\\チ\\\\\\\\ド\\\\\\\\ベ\\\\\\\\ャ\\\\\\\\ヤ\\\\\\\\ン\\\\\\\\・\\\\\\\\丶\\\\\\\\a\\\\\\\\b\\\\\\\\f\\\\\\\\g\\\\\\\\i\\\\\\\\n\\\\\\\\p\\\\\\\\t' + "\\\\\\\\']"
118
 
119
  resampler = torchaudio.transforms.Resample(48_000, 16_000)
120
 
 
74
  Original CER calculation refer to https://huggingface.co/ctl/wav2vec2-large-xlsr-cantonese
75
 
76
  ```python
77
+ #!pip install datasets==1.4.1
78
+ #!pip install transformers==4.4.0
79
+ #!pip install torchaudio
80
+ #!pip install jiwer
81
 
82
  import torch
83
  import torchaudio
 
117
  model = Wav2Vec2ForCTC.from_pretrained("ydshieh/wav2vec2-large-xlsr-53-chinese-zh-cn-gpt")
118
  model.to("cuda")
119
 
120
+ chars_to_ignore_regex = '[\\\\\\\\\\\\\\\\,\\\\\\\\\\\\\\\\?\\\\\\\\\\\\\\\\.\\\\\\\\\\\\\\\\!\\\\\\\\\\\\\\\\-\\\\\\\\\\\\\\\\;\\\\\\\\\\\\\\\\:"\\\\\\\\\\\\\\\\“\\\\\\\\\\\\\\\\%\\\\\\\\\\\\\\\\‘\\\\\\\\\\\\\\\\”\\\\\\\\\\\\\\\\�\\\\\\\\\\\\\\\\.\\\\\\\\\\\\\\\\⋯\\\\\\\\\\\\\\\\!\\\\\\\\\\\\\\\\-\\\\\\\\\\\\\\\\:\\\\\\\\\\\\\\\\–\\\\\\\\\\\\\\\\。\\\\\\\\\\\\\\\\》\\\\\\\\\\\\\\\\,\\\\\\\\\\\\\\\\)\\\\\\\\\\\\\\\\,\\\\\\\\\\\\\\\\?\\\\\\\\\\\\\\\\;\\\\\\\\\\\\\\\\~\\\\\\\\\\\\\\\\~\\\\\\\\\\\\\\\\…\\\\\\\\\\\\\\\\︰\\\\\\\\\\\\\\\\,\\\\\\\\\\\\\\\\(\\\\\\\\\\\\\\\\」\\\\\\\\\\\\\\\\‧\\\\\\\\\\\\\\\\《\\\\\\\\\\\\\\\\﹔\\\\\\\\\\\\\\\\、\\\\\\\\\\\\\\\\—\\\\\\\\\\\\\\\\/\\\\\\\\\\\\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