Update README.md
Browse files
README.md
CHANGED
@@ -8,6 +8,11 @@ tags:
|
|
8 |
|
9 |
# Cascaded Japanese Speech2Text Translation
|
10 |
This is a pipeline for speech-to-text translation from Japanese speech to any target language text based on the cascaded approach, that consists of ASR and translation.
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
## Usage
|
13 |
Here is an example to translate Japanese speech into English text translation.
|
@@ -24,7 +29,7 @@ from transformers import pipeline
|
|
24 |
pipe = pipeline(
|
25 |
model="japanese-asr/ja-cascaded-s2t-translation",
|
26 |
model_kwargs={"attn_implementation": "sdpa"},
|
27 |
-
model_translation="facebook/nllb-200-
|
28 |
tgt_lang="eng_Latn",
|
29 |
chunk_length_s=15,
|
30 |
trust_remote_code=True,
|
@@ -33,3 +38,12 @@ pipe = pipeline(
|
|
33 |
# translate
|
34 |
output = pipe("./sample_ja.flac")
|
35 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
# Cascaded Japanese Speech2Text Translation
|
10 |
This is a pipeline for speech-to-text translation from Japanese speech to any target language text based on the cascaded approach, that consists of ASR and translation.
|
11 |
+
The pipeline employs [kotoba-tech/kotoba-whisper-v2.0](https://huggingface.co/kotoba-tech/kotoba-whisper-v2.0) for ASR (Japanese speech -> Japanese text)
|
12 |
+
and [facebook/nllb-200-3.3B](https://huggingface.co/facebook/nllb-200-3.3B) for text translation.
|
13 |
+
The input must be Japanese speech, while the translation can be in any languages NLLB trained on. Please find the all available languages and their language codes
|
14 |
+
[here](https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200).
|
15 |
+
|
16 |
|
17 |
## Usage
|
18 |
Here is an example to translate Japanese speech into English text translation.
|
|
|
29 |
pipe = pipeline(
|
30 |
model="japanese-asr/ja-cascaded-s2t-translation",
|
31 |
model_kwargs={"attn_implementation": "sdpa"},
|
32 |
+
model_translation="facebook/nllb-200-3.3B",
|
33 |
tgt_lang="eng_Latn",
|
34 |
chunk_length_s=15,
|
35 |
trust_remote_code=True,
|
|
|
38 |
# translate
|
39 |
output = pipe("./sample_ja.flac")
|
40 |
```
|
41 |
+
|
42 |
+
|
43 |
+
Other NLLB models can be used by setting `model_translation` such as following.
|
44 |
+
- [facebook/nllb-200-3.3B](https://huggingface.co/facebook/nllb-200-3.3B)
|
45 |
+
- [facebook/nllb-200-distilled-600M](https://huggingface.co/facebook/nllb-200-distilled-600M)
|
46 |
+
- [facebook/nllb-200-distilled-1.3B](https://huggingface.co/facebook/nllb-200-distilled-1.3B)
|
47 |
+
- [facebook/nllb-200-1.3B](https://huggingface.co/facebook/nllb-200-1.3B)
|
48 |
+
|
49 |
+
|