Update README.md
Browse files
README.md
CHANGED
@@ -18,8 +18,13 @@ This model can be used in CTranslate2 or projects based on CTranslate2 such as [
|
|
18 |
Install library and download sample audio.
|
19 |
```shell
|
20 |
pip install faster-whisper
|
21 |
-
wget https://huggingface.co/
|
|
|
|
|
|
|
|
|
22 |
```
|
|
|
23 |
Inference with the kotoba-whisper-bilingual-v1.0-faster.
|
24 |
|
25 |
```python
|
@@ -27,9 +32,26 @@ from faster_whisper import WhisperModel
|
|
27 |
|
28 |
model = WhisperModel("kotoba-tech/kotoba-whisper-bilingual-v1.0-faster")
|
29 |
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
for segment in segments:
|
32 |
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
|
|
|
33 |
```
|
34 |
|
35 |
### Benchmark
|
|
|
18 |
Install library and download sample audio.
|
19 |
```shell
|
20 |
pip install faster-whisper
|
21 |
+
wget https://huggingface.co/datasets/japanese-asr/en_asr.esb_eval/resolve/main/sample.wav -O sample_en.wav
|
22 |
+
wget https://huggingface.co/datasets/japanese-asr/ja_asr.jsut_basic5000/resolve/main/sample.flac -O sample_ja.flac
|
23 |
+
ffmpeg -i sample_en.wav -ar 16000 -ac 1 -c:a pcm_s16le sample_en_fixed.wav
|
24 |
+
ffmpeg -i sample_ja.flac -ar 16000 -ac 1 -c:a pcm_s16le sample_ja_fixed.wav
|
25 |
+
|
26 |
```
|
27 |
+
|
28 |
Inference with the kotoba-whisper-bilingual-v1.0-faster.
|
29 |
|
30 |
```python
|
|
|
32 |
|
33 |
model = WhisperModel("kotoba-tech/kotoba-whisper-bilingual-v1.0-faster")
|
34 |
|
35 |
+
# Japanese ASR
|
36 |
+
segments, info = model.transcribe("sample_ja.flac", language="ja", task="transcribe", chunk_length=15, condition_on_previous_text=False)
|
37 |
+
for segment in segments:
|
38 |
+
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
|
39 |
+
|
40 |
+
# English ASR
|
41 |
+
segments, info = model.transcribe("sample_en_fixed.wav", language="en", task="transcribe", chunk_length=15, condition_on_previous_text=False)
|
42 |
+
for segment in segments:
|
43 |
+
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
|
44 |
+
|
45 |
+
# Japanese (speech) to English (text) Translation
|
46 |
+
segments, info = model.transcribe("sample_ja.flac", language="en", task="translate", chunk_length=15, condition_on_previous_text=False)
|
47 |
+
for segment in segments:
|
48 |
+
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
|
49 |
+
|
50 |
+
# English (speech) to Japanese (text) Translation
|
51 |
+
segments, info = model.transcribe("sample_en.wav", language="ja", task="translate", chunk_length=15, condition_on_previous_text=False)
|
52 |
for segment in segments:
|
53 |
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
|
54 |
+
|
55 |
```
|
56 |
|
57 |
### Benchmark
|