pere commited on
Commit
5165b75
1 Parent(s): 02c09bb

updated template

Browse files
Files changed (1) hide show
  1. README.md +9 -6
README.md CHANGED
@@ -112,23 +112,26 @@ asr("king.mp3", generate_kwargs={'task': 'transcribe', 'language': 'no'})
112
  </details>
113
 
114
  #### Extended HuggingFace
115
- Examining the output above, we see that there are multiple repetitions at the end. This is because the default length is 30 seconds and the video is 1:25 minutes. By passing the ```chunk_lengt_s``` argument, we can transcribe longer file. The examples below also illustrates how to transcribe to English or Nynorsk, and how to get timestamps for sentences and words.
116
 
117
  ```python
118
  # Long Transcripts
119
- asr("king.mp3", chunk_length_s=30, generate_kwargs={'task': 'transcribe', 'language': 'no'})
 
 
 
120
 
121
  # Return Timestamps
122
- asr("king.mp3", chunk_length_s=30, return_timestamps=True, generate_kwargs={'task': 'transcribe', 'language': 'no'})
123
 
124
  # Return Word Level Timestamps
125
- asr("king.mp3", chunk_length_s=30, return_timestamps="word", generate_kwargs={'task': 'transcribe', 'language': 'no'})
126
 
127
  # Transcribe to Nynorsk
128
- asr("king.mp3", chunk_length_s=30, generate_kwargs={'task': 'transcribe', 'language': 'nn'})
129
 
130
  # Transcribe to English
131
- asr("king.mp3", chunk_length_s=30, generate_kwargs={'task': 'transcribe', 'language': 'en'})
132
 
133
  ```
134
  <details>
 
112
  </details>
113
 
114
  #### Extended HuggingFace
115
+ Examining the output above, we see that there are multiple repetitions at the end. This is because the video is longer than 30 seconds. By passing the ```chunk_lengt_s``` argument, we can transcribe longer file. Our experience is that we get slightly better result by setting that to 28 seconds instead of the default 30 seconds. We also recommend setting the beam size to 5 if possible. This greatly increases the accuracy but takes a bit longer and requires slightly more memory. The examples below also illustrates how to transcribe to English or Nynorsk, and how to get timestamps for sentences and words.
116
 
117
  ```python
118
  # Long Transcripts
119
+ asr("king.mp3", chunk_length_s=28, generate_kwargs={'task': 'transcribe', 'language': 'no'})
120
+
121
+ # Increase accuracy by setting beam size to 5
122
+ asr("king.mp3", chunk_length_s=28, return_timestamps=True, generate_kwargs={'num_beams': 5, 'task': 'transcribe', 'language': 'no'})
123
 
124
  # Return Timestamps
125
+ asr("king.mp3", chunk_length_s=28, return_timestamps=True, generate_kwargs={'task': 'transcribe', 'language': 'no'})
126
 
127
  # Return Word Level Timestamps
128
+ asr("king.mp3", chunk_length_s=28, return_timestamps="word", generate_kwargs={'task': 'transcribe', 'language': 'no'})
129
 
130
  # Transcribe to Nynorsk
131
+ asr("king.mp3", chunk_length_s=28, generate_kwargs={'task': 'transcribe', 'language': 'nn'})
132
 
133
  # Transcribe to English
134
+ asr("king.mp3", chunk_length_s=28, generate_kwargs={'task': 'transcribe', 'language': 'en'})
135
 
136
  ```
137
  <details>