## File: README.md # Seamless Intro Seamless is a family of AI models that enable more natural and authentic communication across languages. SeamlessM4T is a massive multilingual multimodal machine translation model supporting around 100 languages. SeamlessM4T serves as foundation for SeamlessExpressive, a model that preserves elements of prosody and voice style across languages and SeamlessStreaming, a model supporting simultaneous translation and streaming ASR for around 100 languages. SeamlessExpressive and SeamlessStreaming are combined into Seamless, a unified model featuring multilinguality, real-time and expressive translations. ## Links ### Demos | | SeamlessM4T v2 | SeamlessExpressive | SeamlessStreaming | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- | | Demo | [SeamlessM4T v2 Demo](https://seamless.metademolab.com/m4t?utm_source=github&utm_medium=web&utm_campaign=seamless&utm_content=readme) | [SeamlessExpressive Demo](https://seamless.metademolab.com/expressive?utm_source=github&utm_medium=web&utm_campaign=seamless&utm_content=readme) | | | HuggingFace Space Demo | [🤗 SeamlessM4T v2 Space](https://huggingface.co/spaces/facebook/seamless-m4t-v2-large) | [🤗 SeamlessExpressive Space](https://huggingface.co/spaces/facebook/seamless-expressive) | [🤗 SeamlessStreaming Space](https://huggingface.co/spaces/facebook/seamless-streaming) | ### Papers [Seamless](https://ai.facebook.com/research/publications/seamless-multilingual-expressive-and-streaming-speech-translation/) [EMMA](https://ai.meta.com/research/publications/efficient-monotonic-multihead-attention/) [SONAR](https://ai.meta.com/research/publications/sonar-expressive-zero-shot-expressive-speech-to-speech-translation/) ### Blog [AI at Meta Blog](https://ai.meta.com/research/seamless-communication/) ## Tutorial An exhaustive [tutorial](Seamless_Tutorial.ipynb) given at the NeurIPS 2023 - Seamless EXPO, which is a one-stop shop to learn how to use the entire suite of Seamless models. Please feel free to play with the notebook. ## SeamlessM4T SeamlessM4T is our foundational all-in-one **M**assively **M**ultilingual and **M**ultimodal **M**achine **T**ranslation model delivering high-quality translation for speech and text in nearly 100 languages. SeamlessM4T models support the tasks of: - Speech-to-speech translation (S2ST) - Speech-to-text translation (S2TT) - Text-to-speech translation (T2ST) - Text-to-text translation (T2TT) - Automatic speech recognition (ASR) :star2: We are releasing SeamlessM4T v2, an updated version with our novel *UnitY2* architecture. This new model improves over SeamlessM4T v1 in quality as well as inference latency in speech generation tasks. To learn more about the collection of SeamlessM4T models, the approach used in each, their language coverage and their performance, visit the [SeamlessM4T README](docs/m4t/README.md) or [🤗 Model Card](https://huggingface.co/facebook/seamless-m4t-v2-large). > [!NOTE] > Seamless M4T is also available in the 🤗 Transformers library. Visit [this section](docs/m4t/README.md#transformers-usage) for more details. ## SeamlessExpressive SeamlessExpressive is a speech-to-speech translation model that captures certain underexplored aspects of prosody such as speech rate and pauses, while preserving the style of one's voice and high content translation quality. To learn more about SeamlessExpressive models, visit the [SeamlessExpressive README](docs/expressive/README.md) or [🤗 Model Card](https://huggingface.co/facebook/seamless-expressive) ## SeamlessStreaming SeamlessStreaming is a streaming translation model. The model supports speech as input modality and speech/text as output modalities. The SeamlessStreaming model supports the following tasks: - Speech-to-speech translation (S2ST) - Speech-to-text translation (S2TT) - Automatic speech recognition (ASR) To learn more about SeamlessStreaming models, visit the [SeamlessStreaming README](docs/streaming/README.md) or [🤗 Model Card](https://huggingface.co/facebook/seamless-streaming) ## Seamless The Seamless model is the unified model for expressive streaming speech-to-speech translations. ## What's new - [12/18/2023] We are open-sourcing our Conformer-based [W2v-BERT 2.0 speech encoder](#w2v-bert-20-speech-encoder) as described in Section 3.2.1 of the [paper](https://arxiv.org/pdf/2312.05187.pdf), which is at the core of our Seamless models. - [12/14/2023] We are releasing the Seamless [tutorial](#tutorial) given at NeurIPS 2023. # Quick Start ## Installation > [!NOTE] > One of the prerequisites is [fairseq2](https://github.com/facebookresearch/fairseq2) which has pre-built packages available only > for Linux x86-64 and Apple-silicon Mac computers. In addition it has a dependency on [libsndfile](https://github.com/libsndfile/libsndfile) which > might not be installed on your machine. If you experience any installation issues, please refer to its > [README](https://github.com/facebookresearch/fairseq2) for further instructions. ``` pip install . ``` > [!NOTE] > Transcribing inference audio for computing metric uses [Whisper](https://github.com/openai/whisper#setup), which is automatically installed. Whisper in turn requires the command-line tool [`ffmpeg`](https://ffmpeg.org/) to be installed on your system, which is available from most package managers. ## Running inference ### SeamlessM4T Inference Here’s an example of using the CLI from the root directory to run inference. S2ST task: ```bash m4t_predict --task s2st --tgt_lang --output_path ``` T2TT task: ```bash m4t_predict --task t2tt --tgt_lang --src_lang ``` Please refer to the [inference README](src/seamless_communication/cli/m4t/predict) for detailed instruction on how to run inference and the list of supported languages on the source, target sides for speech, text modalities. For running S2TT/ASR natively (without Python) using GGML, please refer to [the unity.cpp section](#unitycpp). ### SeamlessExpressive Inference > [!NOTE] > Please check the [section](#seamlessexpressive-models) on how to download the model. Here’s an example of using the CLI from the root directory to run inference. ```bash expressivity_predict --tgt_lang --model_name seamless_expressivity --vocoder_name vocoder_pretssel --output_path ``` ### SeamlessStreaming and Seamless Inference [Streaming Evaluation README](src/seamless_communication/cli/streaming) has detailed instructions for running evaluations for the SeamlessStreaming and Seamless models. The CLI has an `--no-scoring` option that can be used to skip the scoring part and just run inference. Please check the inference [README](src/seamless_communication/inference) for more details. ## Running SeamlessStreaming Demo You can duplicate the [SeamlessStreaming HF space](https://huggingface.co/spaces/facebook/seamless-streaming?duplicate=true) to run the streaming demo. You can also run the demo locally, by cloning the space from [here](https://huggingface.co/spaces/facebook/seamless-streaming/tree/main). See the [README](https://huggingface.co/spaces/facebook/seamless-streaming/blob/main/README.md) of the SeamlessStreaming HF repo for more details on installation. ## Running SeamlessM4T & SeamlessExpressive [Gradio](https://github.com/gradio-app/gradio) demos locally To launch the same demo Space we host on Hugging Face locally: ```bash cd demo pip install -r requirements.txt python app.py ``` # Resources and usage ## Model ### SeamlessM4T models | Model Name | #params | checkpoint | metrics | | ----------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | | SeamlessM4T-Large v2 | 2.3B | [🤗 Model card](https://huggingface.co/facebook/seamless-m4t-v2-large) - [checkpoint](https://huggingface.co/facebook/seamless-m4t-v2-large/resolve/main/seamlessM4T_v2_large.pt ) | [metrics](https://dl.fbaipublicfiles.com/seamless/metrics/seamlessM4T_large_v2.zip) | | SeamlessM4T-Large (v1) | 2.3B | [🤗 Model card](https://huggingface.co/facebook/seamless-m4t-large) - [checkpoint](https://huggingface.co/facebook/seamless-m4t-large/resolve/main/multitask_unity_large.pt) | [metrics](https://dl.fbaipublicfiles.com/seamless/metrics/seamlessM4T_large.zip) | | SeamlessM4T-Medium (v1) | 1.2B | [🤗 Model card](https://huggingface.co/facebook/seamless-m4t-medium) - [checkpoint](https://huggingface.co/facebook/seamless-m4t-medium/resolve/main/multitask_unity_medium.pt) | [metrics](https://dl.fbaipublicfiles.com/seamless/metrics/seamlessM4T_medium.zip) | ### SeamlessExpressive models [🤗 Model card](https://huggingface.co/facebook/seamless-expressive) To access and download SeamlessExpressive, please request the model artifacts through [this request form](https://ai.meta.com/resources/models-and-libraries/seamless-downloads/). Upon approval, you will then receive an email with download links to each model artifact. Please note that SeamlessExpressive is made available under its own [License](SEAMLESS_LICENSE) and [Acceptable Use Policy](ACCEPTABLE_USE_POLICY). ### SeamlessStreaming models | Model Name | #params | checkpoint | metrics | | ----------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | SeamlessStreaming | 2.5B | [🤗 Model card](https://huggingface.co/facebook/seamless-streaming) - [monotonic decoder checkpoint](https://huggingface.co/facebook/seamless-streaming/resolve/main/seamless_streaming_monotonic_decoder.pt) - [streaming UnitY2 checkpoint](https://huggingface.co/facebook/seamless-streaming/resolve/main/seamless_streaming_unity.pt) | [metrics](https://dl.fbaipublicfiles.com/seamless/metrics/streaming/seamless_streaming.zip) | ### Seamless models Seamless model is simply the SeamlessStreaming model with the non-expressive `vocoder_v2` swapped out with the expressive `vocoder_pretssel`. Please check out above [section](#seamlessexpressive-models) on how to acquire `vocoder_pretssel` checkpoint. ### W2v-BERT 2.0 speech encoder | Model Name | #params | checkpoint | | ----------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | W2v-BERT 2.0 | 600M | [🤗 Model card](https://huggingface.co/facebook/conformer-shaw) - [checkpoint](https://huggingface.co/facebook/conformer-shaw/resolve/main/conformer_shaw.pt) Here's how you should do a foward pass through the speech encoder: ```python import torch from fairseq2.data.audio import AudioDecoder, WaveformToFbankConverter from fairseq2.memory import MemoryBlock from fairseq2.nn.padding import get_seqs_and_padding_mask from fairseq2.data import Collater from pathlib import Path from seamless_communication.models.conformer_shaw import load_conformer_shaw_model audio_wav_path, device, dtype = ... audio_decoder = AudioDecoder(dtype=torch.float32, device=device) fbank_converter = WaveformToFbankConverter( num_mel_bins=80, waveform_scale=2**15, channel_last=True, standardize=True, device=device, dtype=dtype, ) collater = Collater(pad_value=1) model = load_conformer_shaw_model("conformer_shaw", device=device, dtype=dtype) model.eval() with Path(audio_wav_path).open("rb") as fb: block = MemoryBlock(fb.read()) decoded_audio = audio_decoder(block) src = collater(fbank_converter(decoded_audio))["fbank"] seqs, padding_mask = get_seqs_and_padding_mask(src) with torch.inference_mode(): seqs, padding_mask = model.encoder_frontend(seqs, padding_mask) seqs, padding_mask = model.encoder(seqs, padding_mask) ``` ## Evaluation ### SeamlessM4T Evaluation To reproduce our results, or to evaluate using the same metrics over your own test sets, please check out the [README here](src/seamless_communication/cli/m4t/evaluate). ### SeamlessExpressive Evaluation Below is the script for efficient batched evaluation. ```bash export MODEL_DIR="/path/to/SeamlessExpressive/model" export TEST_SET_TSV="input.tsv" # Your dataset in a TSV file, with headers "id", "audio" export TGT_LANG="spa" # Target language to translate into, options including "fra", "deu", "eng" ("cmn" and "ita" are experimental) export OUTPUT_DIR="tmp/" # Output directory for generated text/unit/waveform export TGT_TEXT_COL="tgt_text" # The column in your ${TEST_SET_TSV} for reference target text to calcuate BLEU score. You can skip this argument. export DFACTOR="1.0" # Duration factor for model inference to tune predicted duration (preddur=DFACTOR*preddur) per each position which affects output speech rate. Greater value means slower speech rate (default to 1.0). See expressive evaluation README for details on duration factor we used. expressivity_evaluate ${TEST_SET_TSV} \ --gated-model-dir ${MODEL_DIR} --task s2st --tgt_lang ${TGT_LANG} \ --audio_root_dir "" --output_path ${OUTPUT_DIR} --ref_field ${TGT_TEXT_COL} \ --model_name seamless_expressivity --vocoder_name vocoder_pretssel \ --text_unk_blocking True --duration_factor ${DFACTOR} ``` Please check out this [README section](docs/expressive/README.md#automatic-evaluation) ### SeamlessStreaming and Seamless Evaluation [Streaming Evaluation README](src/seamless_communication/cli/streaming) has detailed instructions for running evaluations on the SeamlessStreaming and Seamless models. ## Unity.cpp To enable Seamless Communication Everywhere, we implemented unity.cpp so users could run SeamlessM4T models in GGML - a C tensor library allowing easier integration on verbose platforms. To transcribe/translte a given audio, ``` ./ggml/bin/unity --model seamlessM4T_medium.ggml input.wav ``` For details of build and more usage please check out [unity.cpp](ggml) ## Expressive Datasets We created two expressive speech-to-speech translation datasets, mExpresso and mDRAL, between English and five other languages -- French, German, Italian, Mandarin and Spanish. We currently open source the speech-to-text of mExpresso for out-of-English directions, and we will open source the remaining part of the datasets soon. For details, please check out [README](docs/expressive/README.md#benchmark-datasets) ### SeamlessAlignExpressive We’re introducing the first expressive speech alignment procedure. Starting with raw data, the expressive alignment procedure automatically discovers pairs of audio segments sharing not only the same meaning, but the same overall expressivity. To showcase this procedure, we are making metadata available to create a benchmarking dataset called SeamlessAlignExpressive, that can be used to validate the quality of our alignment method. SeamlessAlignExpressive is the first large-scale (11k+ hours) collection of multilingual audio alignments for expressive translation. More details can be found on the [SeamlessAlignExpressive README](docs/expressive/seamless_align_expressive_README.md). ## Converting raw audio to units Please check out the [README here](src/seamless_communication/cli/m4t/audio_to_units). Note that SeamlessM4T v1 model uses reduced units and other models use non-reduced units. # Libraries Seamless Communication depends on 4 libraries developed by Meta. ## [fairseq2](https://github.com/facebookresearch/fairseq2) fairseq2 is our next-generation open-source library of sequence modeling components that provides researchers and developers with building blocks for machine translation, language modeling, and other sequence generation tasks. All SeamlessM4T models in this repository are powered by fairseq2. ## [SONAR and BLASER 2.0](https://github.com/facebookresearch/SONAR) SONAR, Sentence-level multimOdal and laNguage-Agnostic Representations is a new multilingual and -modal sentence embedding space which outperforms existing sentence embeddings such as LASER3 and LabSE on the xsim and xsim++ multilingual similarity search tasks. SONAR provides text and speech encoders for many languages. SeamlessAlign was mined based on SONAR embeddings. BLASER 2.0 is our latest model-based evaluation metric for multimodal translation. It is an extension of BLASER, supporting both speech and text. It operates directly on the source signal, and as such, does not require any intermediate ASR system like ASR-BLEU. As in the first version, BLASER 2.0 leverages the similarity between input and output sentence embeddings. SONAR is the underlying embedding space for BLASER 2.0. Scripts to run evaluation with BLASER 2.0 can be found in the [SONAR repo](https://github.com/facebookresearch/SONAR). ## [stopes](https://github.com/facebookresearch/stopes) As part of the seamless communication project, we've extended the stopes library. Version 1 provided a text-to-text mining tool to build training dataset for translation models. Version 2 has been extended thanks to SONAR, to support tasks around training large speech translation models. In particular, we provide tools to read/write the fairseq audiozip datasets and a new mining pipeline that can do speech-to-speech, text-to-speech, speech-to-text and text-to-text mining, all based on the new SONAR embedding space. ## [SimulEval](https://github.com/facebookresearch/SimulEval) SimulEval is a library used for evaluating simulaneous translation models. SimulEval also provides a backend for generation using partial/incremental inputs with flexible/extensible states, which is used to implement streaming inference. Users define agents which implement SimulEval's interface, which can be connected together in a pipeline. You can find agents implemented for SeamlessStreaming [here](src/seamless_communication/streaming/agents). ## [Legacy] SeamlessM4T v1 instructions #### Finetuning SeamlessM4T v1 models Please check out the [README here](src/seamless_communication/cli/m4t/finetune). #### On-device models Apart from Seamless-M4T large (2.3B) and medium (1.2B) models, we are also releasing a small model (281M) targeted for on-device inference. To learn more about the usage and model details check out the [README here](docs/m4t/on_device_README.md). #### SeamlessAlign mined dataset We open-source the metadata to SeamlessAlign, the largest open dataset for multimodal translation, totaling 270k+ hours of aligned Speech and Text data. The dataset can be rebuilt by the community based on the [SeamlessAlign readme](docs/m4t/seamless_align_README.md). # Citation If you use Seamless in your work or any models/datasets/artifacts published in Seamless, please cite : ```bibtex @inproceedings{seamless2023, title="Seamless: Multilingual Expressive and Streaming Speech Translation", author="{Seamless Communication}, Lo{\"i}c Barrault, Yu-An Chung, Mariano Coria Meglioli, David Dale, Ning Dong, Mark Duppenthaler, Paul-Ambroise Duquenne, Brian Ellis, Hady Elsahar, Justin Haaheim, John Hoffman, Min-Jae Hwang, Hirofumi Inaguma, Christopher Klaiber, Ilia Kulikov, Pengwei Li, Daniel Licht, Jean Maillard, Ruslan Mavlyutov, Alice Rakotoarison, Kaushik Ram Sadagopan, Abinesh Ramakrishnan, Tuan Tran, Guillaume Wenzek, Yilin Yang, Ethan Ye, Ivan Evtimov, Pierre Fernandez, Cynthia Gao, Prangthip Hansanti, Elahe Kalbassi, Amanda Kallet, Artyom Kozhevnikov, Gabriel Mejia, Robin San Roman, Christophe Touret, Corinne Wong, Carleigh Wood, Bokai Yu, Pierre Andrews, Can Balioglu, Peng-Jen Chen, Marta R. Costa-juss{\`a}, Maha Elbayad, Hongyu Gong, Francisco Guzm{\'a}n, Kevin Heffernan, Somya Jain, Justine Kao, Ann Lee, Xutai Ma, Alex Mourachko, Benjamin Peloquin, Juan Pino, Sravya Popuri, Christophe Ropers, Safiyyah Saleem, Holger Schwenk, Anna Sun, Paden Tomasello, Changhan Wang, Jeff Wang, Skyler Wang, Mary Williamson", journal={ArXiv}, year={2023} } ``` # License We have three license categories. The following non-generative components are MIT licensed as found in [MIT_LICENSE](MIT_LICENSE): - [W2v-BERT 2.0 speech encoder](#w2v-bert-20-speech-encoder) - Code - Text only part of the mExpresso dataset found in the [SeamlessExpressive README](docs/expressive/README.md). - UnitY2 forced alignment extractor found in the [UnitY2 Aligner README](docs/m4t/unity2_aligner_README.md). - Speech toxicity tool with the etox dataset found in the [ETOX README](src/seamless_communication/cli/toxicity/etox). - MuTox: Universal MUltilingual Audio-based TOXicity Dataset and Zero-shot Detector [Mutox README](src/seamless_communication/cli/toxicity/mutox) The following models are CC-BY-NC 4.0 licensed as found in the [LICENSE](LICENSE): - SeamlessM4T models (v1 and v2). - SeamlessStreaming models. The following models are Seamless licensed as found in [SEAMLESS_LICENSE](SEAMLESS_LICENSE): - Seamless models. - SeamlessExpressive models. --- ## File: docs/streaming/README.md # SeamlessStreaming SeamlessStreaming is a multilingual streaming translation model. It supports: - Streaming Automatic Speech Recognition on 96 languages. - Simultaneous translation on 101 source languages for speech input. - Simultaneous translation on 96 target languages for text output. - Simultaneous translation on 36 target languages for speech output. Check out the SeamlessM4T [README](../m4t/README.md) for more details on supported languages. ## SeamlessStreaming models | Model Name | #params | checkpoint | metrics | | ------------------ | ------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | SeamlessStreaming | 2.5B | [🤗 Model card](https://huggingface.co/facebook/seamless-streaming) - [monotonic decoder checkpoint](https://huggingface.co/facebook/seamless-streaming/resolve/main/seamless_streaming_monotonic_decoder.pt) - [streaming UnitY2 checkpoint](https://huggingface.co/facebook/seamless-streaming/resolve/main/seamless_streaming_unity.pt) | [metrics](https://dl.fbaipublicfiles.com/seamless/metrics/streaming/seamless_streaming.zip) | The evaluation data ids for FLEURS, CoVoST2 and CVSS-C can be found [here](https://dl.fbaipublicfiles.com/seamless/metrics/evaluation_data_ids.zip) ## Evaluating SeamlessStreaming models To reproduce our results, or to evaluate using the same metrics over your own test sets, please check out the [Evaluation README here](../../src/seamless_communication/cli/streaming/README.md). Streaming evaluation depends on the SimulEval library. ## Citation For EMMA, please cite : ```bibtex @article{ma_efficient_2023, author={Ma, Xutai and Sun, Anna and Ouyang, Siqi and Inaguma, Hirofumi and Tomasello, Paden}, title={Efficient Monotonic Multihead Attention}, year={2023}, url={https://ai.meta.com/research/publications/efficient-monotonic-multihead-attention/}, } ``` For SeamlessStreaming, please cite : ```bibtex @inproceedings{seamless2023, title="Seamless: Multilingual Expressive and Streaming Speech Translation", author="{Seamless Communication}, Lo{\"i}c Barrault, Yu-An Chung, Mariano Coria Meglioli, David Dale, Ning Dong, Mark Duppenthaler, Paul-Ambroise Duquenne, Brian Ellis, Hady Elsahar, Justin Haaheim, John Hoffman, Min-Jae Hwang, Hirofumi Inaguma, Christopher Klaiber, Ilia Kulikov, Pengwei Li, Daniel Licht, Jean Maillard, Ruslan Mavlyutov, Alice Rakotoarison, Kaushik Ram Sadagopan, Abinesh Ramakrishnan, Tuan Tran, Guillaume Wenzek, Yilin Yang, Ethan Ye, Ivan Evtimov, Pierre Fernandez, Cynthia Gao, Prangthip Hansanti, Elahe Kalbassi, Amanda Kallet, Artyom Kozhevnikov, Gabriel Mejia, Robin San Roman, Christophe Touret, Corinne Wong, Carleigh Wood, Bokai Yu, Pierre Andrews, Can Balioglu, Peng-Jen Chen, Marta R. Costa-juss{\`a}, Maha Elbayad, Hongyu Gong, Francisco Guzm{\'a}n, Kevin Heffernan, Somya Jain, Justine Kao, Ann Lee, Xutai Ma, Alex Mourachko, Benjamin Peloquin, Juan Pino, Sravya Popuri, Christophe Ropers, Safiyyah Saleem, Holger Schwenk, Anna Sun, Paden Tomasello, Changhan Wang, Jeff Wang, Skyler Wang, Mary Williamson", journal={ArXiv}, year={2023} } ``` --- ## File: docs/m4t/on_device_README.md # On-device Models [Experimental] Apart from SeamlessM4T-LARGE (2.3B) and SeamlessM4T-MEDIUM (1.2B) models, we are also developing a small model (281M) targeting for on-device inference. This folder contains an example to run an exported small model covering most tasks (ASR/S2TT/S2ST). The model could be executed on popular mobile devices with Pytorch Mobile (https://pytorch.org/mobile/home/). ## Updates [2023/8/23] Uploaded new on-device models with several fixes to reduce size and avoid OOM. Metrics should be close to what's reported below, will rerun eval and update. ## Overview | Model | Checkpoint | Num Params | Disk Size | Supported Tasks | Supported Languages| |---------|------------|----------|-------------|------------|-------------------------| | UnitY-Small|[🤗 Model card](https://huggingface.co/facebook/seamless-m4t-unity-small) - [checkpoint](https://huggingface.co/facebook/seamless-m4t-unity-small/resolve/main/unity_on_device.ptl) | 281M | 747MB | S2ST, S2TT, ASR |eng, fra, hin, por, spa| | UnitY-Small-S2T |[🤗 Model card](https://huggingface.co/facebook/seamless-m4t-unity-small-s2t) - [checkpoint](https://huggingface.co/facebook/seamless-m4t-unity-small-s2t/resolve/main/unity_on_device_s2t.ptl) | 235M | 481MB | S2TT, ASR |eng, fra,hin, por, spa| UnitY-Small-S2T is a pruned version of UnitY-Small without 2nd pass unit decoding. ## Inference To use exported model, users don't need seamless_communication or fairseq2 dependency. ```python import torchaudio import torch audio_input, _ = torchaudio.load(TEST_AUDIO_PATH) # Load waveform using torchaudio s2t_model = torch.jit.load("unity_on_device_s2t.ptl") # Load exported S2T model with torch.no_grad(): text = s2t_model(audio_input, tgt_lang=TGT_LANG) # Forward call with tgt_lang specified for ASR or S2TT print(text) # Show text output s2st_model = torch.jit.load("unity_on_device.ptl") with torch.no_grad(): text, units, waveform = s2st_model(audio_input, tgt_lang=TGT_LANG) # S2ST model also returns waveform print(text) torchaudio.save(f"{OUTPUT_FOLDER}/result.wav", waveform.unsqueeze(0), sample_rate=16000) # Save output waveform to local file ``` Also running the exported model doesn't need python runtime. For example, you could load this model in C++ following [this tutorial](https://pytorch.org/tutorials/advanced/cpp_export.html), or building your own on-device applications similar to [this example](https://github.com/pytorch/ios-demo-app/tree/master/SpeechRecognition) ## Metrics ### S2TT BLEU / S2ST ASR-BLEU on FLEURS For ASR-BLEU, we follow the same protocol as SeamlessM4T Large/Medium models: We used Whisper-large-v2 for Eng-X and Whisper-medium for X-Eng when evaluating ASR BLEU. | Direction | 1st-pass BLEU (S2TT) | 2nd-pass ASR-BLEU (S2ST) |---------|----------------------|----------------------| | eng-hin|10.43|15.06| | eng-por|21.54|17.35| | eng-rus|7.88|5.11| | eng-spa|12.78|11.75| | hin-eng|12.92|10.50| | por-eng|22.99|24.81| | rus-eng|18.24|18.24| | spa-eng|14.37|14.85| ### ASR WER on FLEURS | LANG | WER | |---------|----------------------| | eng|27.3| | hin|41.5| | por|25.2| | rus|33.0| | spa|18.0| --- ## File: docs/m4t/README.md # SeamlessM4T SeamlessM4T is our foundational all-in-one **M**assively **M**ultilingual and **M**ultimodal **M**achine **T**ranslation model delivering high-quality translation for speech and text in nearly 100 languages. SeamlessM4T models support: - :microphone: 101 languages for speech input. - :speech_balloon: 96 Languages for text input/output. - :speaker: 35 languages for speech output. This unified model enables multiple tasks without relying on multiple separate models: - Speech-to-speech translation (S2ST) - Speech-to-text translation (S2TT) - Text-to-speech translation (T2ST) - Text-to-text translation (T2TT) - Automatic speech recognition (ASR). > [!NOTE] > SeamlessM4T v2 and v1 are also supported in the 🤗 Transformers library, more on it [in the dedicated section below](#transformers-usage). ## SeamlessM4T v1 The v1 version of SeamlessM4T is a multitask adaptation of the *UnitY* architecture [(Inaguma et al., 2023)](https://aclanthology.org/2023.acl-long.872/). *UnitY* is a two-pass direct S2ST architecture which first generates textual representations and subsequently predicts discrete acoustic units. ## SeamlessM4T v2 The v2 version of SeamlessM4T is a multitask adaptation of our novel *UnitY2* architecture. *Unity2* with its hierarchical character-to-unit upsampling and non-autoregressive text-to-unit decoding considerably improves over SeamlessM4T v1 in quality and inference speed. ## SeamlessM4T models | Model Name | #params | checkpoint | metrics | | ------------------ | ------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | | SeamlessM4T-Large v2 | 2.3B | [🤗 Model card](https://huggingface.co/facebook/seamless-m4t-v2-large) - [checkpoint](https://huggingface.co/facebook/seamless-m4t-v2-large/resolve/main/seamlessM4T_v2_large.pt) | [metrics](https://dl.fbaipublicfiles.com/seamless/metrics/seamlessM4T_large_v2.zip) | | SeamlessM4T-Large (v1) | 2.3B | [🤗 Model card](https://huggingface.co/facebook/seamless-m4t-large) - [checkpoint](https://huggingface.co/facebook/seamless-m4t-large/resolve/main/multitask_unity_large.pt) | [metrics](https://dl.fbaipublicfiles.com/seamless/metrics/seamlessM4T_large.zip) | | SeamlessM4T-Medium (v1) | 1.2B | [🤗 Model card](https://huggingface.co/facebook/seamless-m4t-medium) - [checkpoint](https://huggingface.co/facebook/seamless-m4t-medium/resolve/main/multitask_unity_medium.pt) | [metrics](https://dl.fbaipublicfiles.com/seamless/metrics/seamlessM4T_medium.zip) | We provide the extensive evaluation results of seamlessM4T-Large and SeamlessM4T-Medium reported in the paper (as averages) in the `metrics` files above. The evaluation data ids for FLEURS, CoVoST2 and CVSS-C can be found [here](https://dl.fbaipublicfiles.com/seamless/metrics/evaluation_data_ids.zip) ## Using SeamlessM4T models ### `m4t_predict` with CLI: Inference is run with the CLI, from the root directory of the repository. The model can be specified with `--model_name` `seamlessM4T_v2_large`, `seamlessM4T_large` or `seamlessM4T_medium`: ```bash # S2ST: m4t_predict --task s2st --tgt_lang --output_path --model_name seamlessM4T_v2_large # S2T: m4t_predict --task s2tt --tgt_lang --model_name seamlessM4T_v2_large # T2TT: m4t_predict --task t2tt --tgt_lang --src_lang --model_name seamlessM4T_v2_large # T2ST: m4t_predict --task t2st --tgt_lang --src_lang --output_path --model_name seamlessM4T_v2_large # ASR: m4t_predict --task asr --tgt_lang --model_name seamlessM4T_v2_large ``` ### Inference with `Translator`: Inference calls for the `Translator` object instantiated with a multitask UnitY or UnitY2 model with the options: - [`seamlessM4T_v2_large`](https://huggingface.co/facebook/seamless-m4t-v2-large) - [`seamlessM4T_large`](https://huggingface.co/facebook/seamless-m4t-large) - [`seamlessM4T_medium`](https://huggingface.co/facebook/seamless-m4t-medium) and a vocoder: - `vocoder_v2` for `seamlessM4T_v2_large`. - `vocoder_36langs` for `seamlessM4T_large` or `seamlessM4T_medium`. ```python import torch from seamless_communication.inference import Translator # Initialize a Translator object with a multitask model, vocoder on the GPU. translator = Translator("seamlessM4T_large", "vocoder_36langs", torch.device("cuda:0"), torch.float16) ``` Now `predict()` can be used to run inference as many times on any of the supported tasks. Given an input audio with `` or an input text `` in ``, we first set the `text_generation_opts`, `unit_generation_opts` and then translate into `` as follows: **S2ST and T2ST (speech output):** ```python # S2ST text_output, speech_output = translator.predict( input=, task_str="S2ST", tgt_lang=, text_generation_opts=text_generation_opts, unit_generation_opts=unit_generation_opts ) # T2ST text_output, speech_output = translator.predict( input=, task_str="T2ST", tgt_lang=, src_lang=, text_generation_opts=text_generation_opts, unit_generation_opts=unit_generation_opts ) ``` Note that `` must be specified for T2ST. The generated units are synthesized and the output audio file is saved with: ```python # Save the translated audio output: import torchaudio torchaudio.save( , speech_output.audio_wavs[0][0].cpu(), sample_rate=speech_output.sample_rate, ) ``` **S2TT, T2TT and ASR (text output):** ```python # S2TT text_output, _ = translator.predict( input=, task_str="S2TT", tgt_lang=, text_generation_opts=text_generation_opts, unit_generation_opts=None ) # ASR # This is equivalent to S2TT with `=`. text_output, _ = translator.predict( input=, task_str="ASR", tgt_lang=, text_generation_opts=text_generation_opts, unit_generation_opts=None ) # T2TT text_output, _ = translator.predict( input=, task_str="T2TT", tgt_lang=, src_lang=, text_generation_opts=text_generation_opts, unit_generation_opts=None ) ``` Note that `` must be specified for T2TT To reproduce the seamless papers results ([v1](https://arxiv.org/abs/2308.11596) or [v2](https://arxiv.org/abs/2312.05187)), or to evaluate using the same metrics over your own test sets, please check out the [Evaluation README here](../../src/seamless_communication/cli/m4t/evaluate/README.md). ## Inference with 🤗 `Transformers` SeamlessM4T is available in the 🤗 Transformers library, requiring minimal dependencies. Steps to get started: 1. First install the 🤗 [Transformers library](https://github.com/huggingface/transformers) from main and [sentencepiece](https://github.com/google/sentencepiece): ``` pip install git+https://github.com/huggingface/transformers.git sentencepiece ``` 2. Run the following Python code to generate speech samples. Here the target language is Russian: ```py import torchaudio from transformers import AutoProcessor, SeamlessM4Tv2Model processor = AutoProcessor.from_pretrained("facebook/seamless-m4t-v2-large") model = SeamlessM4Tv2Model.from_pretrained("facebook/seamless-m4t-v2-large") # from text text_inputs = processor(text="Hello, my dog is cute", src_lang="eng", return_tensors="pt") audio_array_from_text = model.generate(**text_inputs, tgt_lang="rus")[0].cpu().squeeze() # from audio audio, orig_freq = torchaudio.load("https://www2.cs.uic.edu/~i101/SoundFiles/preamble10.wav") audio = torchaudio.functional.resample(audio, orig_freq=orig_freq, new_freq=16_000) # must be a 16 kHz waveform array audio_inputs = processor(audios=audio, return_tensors="pt") audio_array_from_audio = model.generate(**audio_inputs, tgt_lang="rus")[0].cpu().squeeze() ``` 3. Listen to the audio samples either in an ipynb notebook: ```py from IPython.display import Audio sample_rate = model.config.sampling_rate Audio(audio_array_from_text, rate=sample_rate) Audio(audio_array_from_audio, rate=sample_rate) ``` Or save them as a `.wav` file using a third-party library, e.g. `torchaudio`: ```py torchaudio.save( , audio_array_from_audio, # or audio_array_from_text sample_rate=model.config.sampling_rate, ) ``` 2. (bis) To run inference for text generating tasks (T2TT, ASR or S2TT), it is recommended to use [dedicated models](https://huggingface.co/docs/transformers/main/en/model_doc/seamless_m4t_v2#1-use-dedicated-models). With that, only the required sub-modules will be loaded. For exmaple, text-to-text translation from English to Bulgarian, is performed as follows: ```py from transformers import AutoProcessor, SeamlessM4Tv2ForTextToText processor = AutoProcessor.from_pretrained("facebook/seamless-m4t-v2-large") model = SeamlessM4Tv2ForTextToText.from_pretrained("facebook/seamless-m4t-v2-large") src_lang, tgt_lang = "eng", "bul" text_inputs = processor(text='Hello, my dog is cute', src_lang=src_lang, return_tensors="pt") decoder_input_ids = model.generate(**text_inputs, tgt_lang=tgt_lang)[0].tolist() translated_text = processor.decode(decoder_input_ids, skip_special_tokens=True) print(f"{tgt_lang}: {translated_text}") ``` > [!NOTE] > For more details on using the SeamlessM4T model for inference using the 🤗 Transformers library, refer to the [SeamlessM4T v2 docs](https://huggingface.co/docs/transformers/main/en/model_doc/seamless_m4t_v2), the [SeamlessM4T v1 docs](https://huggingface.co/docs/transformers/main/en/model_doc/seamless_m4t) or to this hands-on [Google Colab](https://colab.research.google.com/github/ylacombe/scripts_and_notebooks/blob/main/v2_seamless_m4t_hugging_face.ipynb). ## Finetuning SeamlessM4T models Please check out the [Finetuning README here](../../src/seamless_communication/cli/m4t/finetune/README.md). ## Supported Languages: Listed below, are the languages supported by SeamlessM4T-large (v1/v2). The `source` column specifies whether a language is supported as source speech (`Sp`) and/or source text (`Tx`). The `target` column specifies whether a language is supported as target speech (`Sp`) and/or target text (`Tx`). | code | language | script | Source | Target | | ---- | ---------------------- | ---------- | ------ | ------ | | afr | Afrikaans | Latn | Sp, Tx | Tx | | amh | Amharic | Ethi | Sp, Tx | Tx | | arb | Modern Standard Arabic | Arab | Sp, Tx | Sp, Tx | | ary | Moroccan Arabic | Arab | Sp, Tx | Tx | | arz | Egyptian Arabic | Arab | Sp, Tx | Tx | | asm | Assamese | Beng | Sp, Tx | Tx | | ast | Asturian | Latn | Sp | \-- | | azj | North Azerbaijani | Latn | Sp, Tx | Tx | | bel | Belarusian | Cyrl | Sp, Tx | Tx | | ben | Bengali | Beng | Sp, Tx | Sp, Tx | | bos | Bosnian | Latn | Sp, Tx | Tx | | bul | Bulgarian | Cyrl | Sp, Tx | Tx | | cat | Catalan | Latn | Sp, Tx | Sp, Tx | | ceb | Cebuano | Latn | Sp, Tx | Tx | | ces | Czech | Latn | Sp, Tx | Sp, Tx | | ckb | Central Kurdish | Arab | Sp, Tx | Tx | | cmn | Mandarin Chinese | Hans | Sp, Tx | Sp, Tx | | cmn_Hant | Mandarin Chinese | Hant | Sp, Tx | Sp, Tx | | cym | Welsh | Latn | Sp, Tx | Sp, Tx | | dan | Danish | Latn | Sp, Tx | Sp, Tx | | deu | German | Latn | Sp, Tx | Sp, Tx | | ell | Greek | Grek | Sp, Tx | Tx | | eng | English | Latn | Sp, Tx | Sp, Tx | | est | Estonian | Latn | Sp, Tx | Sp, Tx | | eus | Basque | Latn | Sp, Tx | Tx | | fin | Finnish | Latn | Sp, Tx | Sp, Tx | | fra | French | Latn | Sp, Tx | Sp, Tx | | fuv | Nigerian Fulfulde | Latn | Sp, Tx | Tx | | gaz | West Central Oromo | Latn | Sp, Tx | Tx | | gle | Irish | Latn | Sp, Tx | Tx | | glg | Galician | Latn | Sp, Tx | Tx | | guj | Gujarati | Gujr | Sp, Tx | Tx | | heb | Hebrew | Hebr | Sp, Tx | Tx | | hin | Hindi | Deva | Sp, Tx | Sp, Tx | | hrv | Croatian | Latn | Sp, Tx | Tx | | hun | Hungarian | Latn | Sp, Tx | Tx | | hye | Armenian | Armn | Sp, Tx | Tx | | ibo | Igbo | Latn | Sp, Tx | Tx | | ind | Indonesian | Latn | Sp, Tx | Sp, Tx | | isl | Icelandic | Latn | Sp, Tx | Tx | | ita | Italian | Latn | Sp, Tx | Sp, Tx | | jav | Javanese | Latn | Sp, Tx | Tx | | jpn | Japanese | Jpan | Sp, Tx | Sp, Tx | | kam | Kamba | Latn | Sp | \-- | | kan | Kannada | Knda | Sp, Tx | Tx | | kat | Georgian | Geor | Sp, Tx | Tx | | kaz | Kazakh | Cyrl | Sp, Tx | Tx | | kea | Kabuverdianu | Latn | Sp | \-- | | khk | Halh Mongolian | Cyrl | Sp, Tx | Tx | | khm | Khmer | Khmr | Sp, Tx | Tx | | kir | Kyrgyz | Cyrl | Sp, Tx | Tx | | kor | Korean | Kore | Sp, Tx | Sp, Tx | | lao | Lao | Laoo | Sp, Tx | Tx | | lit | Lithuanian | Latn | Sp, Tx | Tx | | ltz | Luxembourgish | Latn | Sp | \-- | | lug | Ganda | Latn | Sp, Tx | Tx | | luo | Luo | Latn | Sp, Tx | Tx | | lvs | Standard Latvian | Latn | Sp, Tx | Tx | | mai | Maithili | Deva | Sp, Tx | Tx | | mal | Malayalam | Mlym | Sp, Tx | Tx | | mar | Marathi | Deva | Sp, Tx | Tx | | mkd | Macedonian | Cyrl | Sp, Tx | Tx | | mlt | Maltese | Latn | Sp, Tx | Sp, Tx | | mni | Meitei | Beng | Sp, Tx | Tx | | mya | Burmese | Mymr | Sp, Tx | Tx | | nld | Dutch | Latn | Sp, Tx | Sp, Tx | | nno | Norwegian Nynorsk | Latn | Sp, Tx | Tx | | nob | Norwegian Bokmål | Latn | Sp, Tx | Tx | | npi | Nepali | Deva | Sp, Tx | Tx | | nya | Nyanja | Latn | Sp, Tx | Tx | | oci | Occitan | Latn | Sp | \-- | | ory | Odia | Orya | Sp, Tx | Tx | | pan | Punjabi | Guru | Sp, Tx | Tx | | pbt | Southern Pashto | Arab | Sp, Tx | Tx | | pes | Western Persian | Arab | Sp, Tx | Sp, Tx | | pol | Polish | Latn | Sp, Tx | Sp, Tx | | por | Portuguese | Latn | Sp, Tx | Sp, Tx | | ron | Romanian | Latn | Sp, Tx | Sp, Tx | | rus | Russian | Cyrl | Sp, Tx | Sp, Tx | | slk | Slovak | Latn | Sp, Tx | Sp, Tx | | slv | Slovenian | Latn | Sp, Tx | Tx | | sna | Shona | Latn | Sp, Tx | Tx | | snd | Sindhi | Arab | Sp, Tx | Tx | | som | Somali | Latn | Sp, Tx | Tx | | spa | Spanish | Latn | Sp, Tx | Sp, Tx | | srp | Serbian | Cyrl | Sp, Tx | Tx | | swe | Swedish | Latn | Sp, Tx | Sp, Tx | | swh | Swahili | Latn | Sp, Tx | Sp, Tx | | tam | Tamil | Taml | Sp, Tx | Tx | | tel | Telugu | Telu | Sp, Tx | Sp, Tx | | tgk | Tajik | Cyrl | Sp, Tx | Tx | | tgl | Tagalog | Latn | Sp, Tx | Sp, Tx | | tha | Thai | Thai | Sp, Tx | Sp, Tx | | tur | Turkish | Latn | Sp, Tx | Sp, Tx | | ukr | Ukrainian | Cyrl | Sp, Tx | Sp, Tx | | urd | Urdu | Arab | Sp, Tx | Sp, Tx | | uzn | Northern Uzbek | Latn | Sp, Tx | Sp, Tx | | vie | Vietnamese | Latn | Sp, Tx | Sp, Tx | | xho | Xhosa | Latn | Sp | \-- | | yor | Yoruba | Latn | Sp, Tx | Tx | | yue | Cantonese | Hant | Sp, Tx | Tx | | zlm | Colloquial Malay | Latn | Sp | \-- | | zsm | Standard Malay | Latn | Tx | Tx | | zul | Zulu | Latn | Sp, Tx | Tx | Note that seamlessM4T-medium supports 200 languages in the text modality, and is based on NLLB-200 (see full list in [asset card](src/seamless_communication/cards/unity_nllb-200.yaml)) ## Citation For *UnitY*, please cite : ```bibtex @inproceedings{inaguma-etal-2023-unity, title="{U}nit{Y}: Two-pass Direct Speech-to-speech Translation with Discrete Units", author="Inaguma, Hirofumi and Popuri, Sravya and Kulikov, Ilia and Chen, Peng-Jen and Wang, Changhan and Chung, Yu-An and Tang, Yun and Lee, Ann and Watanabe, Shinji and Pino, Juan", booktitle="Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)", year="2023", url="https://aclanthology.org/2023.acl-long.872", } ``` For SeamlessM4T v1, please cite : ```bibtex @article{seamlessm4t2023, title={SeamlessM4T: Massively Multilingual \& Multimodal Machine Translation}, author={{Seamless Communication}, Lo\"{i}c Barrault, Yu-An Chung, Mariano Cora Meglioli, David Dale, Ning Dong, Paul-Ambroise Duquenne, Hady Elsahar, Hongyu Gong, Kevin Heffernan, John Hoffman, Christopher Klaiber, Pengwei Li, Daniel Licht, Jean Maillard, Alice Rakotoarison, Kaushik Ram Sadagopan, Guillaume Wenzek, Ethan Ye, Bapi Akula, Peng-Jen Chen, Naji El Hachem, Brian Ellis, Gabriel Mejia Gonzalez, Justin Haaheim, Prangthip Hansanti, Russ Howes, Bernie Huang, Min-Jae Hwang, Hirofumi Inaguma, Somya Jain, Elahe Kalbassi, Amanda Kallet, Ilia Kulikov, Janice Lam, Daniel Li, Xutai Ma, Ruslan Mavlyutov, Benjamin Peloquin, Mohamed Ramadan, Abinesh Ramakrishnan, Anna Sun, Kevin Tran, Tuan Tran, Igor Tufanov, Vish Vogeti, Carleigh Wood, Yilin Yang, Bokai Yu, Pierre Andrews, Can Balioglu, Marta R. Costa-juss\`{a} \footnotemark[3], Onur \,{C}elebi,Maha Elbayad,Cynthia Gao, Francisco Guzm\'an, Justine Kao, Ann Lee, Alexandre Mourachko, Juan Pino, Sravya Popuri, Christophe Ropers, Safiyyah Saleem, Holger Schwenk, Paden Tomasello, Changhan Wang, Jeff Wang, Skyler Wang}, journal={ArXiv}, year={2023} } ``` For SeamlessM4T v2, please cite : ```bibtex @inproceedings{seamless2023, title="Seamless: Multilingual Expressive and Streaming Speech Translation", author="{Seamless Communication}, Lo{\"i}c Barrault, Yu-An Chung, Mariano Coria Meglioli, David Dale, Ning Dong, Mark Duppenthaler, Paul-Ambroise Duquenne, Brian Ellis, Hady Elsahar, Justin Haaheim, John Hoffman, Min-Jae Hwang, Hirofumi Inaguma, Christopher Klaiber, Ilia Kulikov, Pengwei Li, Daniel Licht, Jean Maillard, Ruslan Mavlyutov, Alice Rakotoarison, Kaushik Ram Sadagopan, Abinesh Ramakrishnan, Tuan Tran, Guillaume Wenzek, Yilin Yang, Ethan Ye, Ivan Evtimov, Pierre Fernandez, Cynthia Gao, Prangthip Hansanti, Elahe Kalbassi, Amanda Kallet, Artyom Kozhevnikov, Gabriel Mejia, Robin San Roman, Christophe Touret, Corinne Wong, Carleigh Wood, Bokai Yu, Pierre Andrews, Can Balioglu, Peng-Jen Chen, Marta R. Costa-juss{\`a}, Maha Elbayad, Hongyu Gong, Francisco Guzm{\'a}n, Kevin Heffernan, Somya Jain, Justine Kao, Ann Lee, Xutai Ma, Alex Mourachko, Benjamin Peloquin, Juan Pino, Sravya Popuri, Christophe Ropers, Safiyyah Saleem, Holger Schwenk, Anna Sun, Paden Tomasello, Changhan Wang, Jeff Wang, Skyler Wang, Mary Williamson", journal={ArXiv}, year={2023} } ``` --- ## File: docs/m4t/seamless_align_README.md # Seamless - Speech to Speech and Speech to Text Metadata This document contains metadata information for reconstructing the dataset we used for training our models. ## Format The metadata format is similar to [NLLB bitext format](https://github.com/facebookresearch/LASER/tree/main/data/nllb200) with some small differences. The metadata files are tab separated, gzip files. Each file corresponds to one alignment direction. File naming convention: - for text, we use 3 letters: e.g. `fra`, `eng`, `tur` - for audio, we use 2 letters and a 'A': e.g. `frA`, `enA`, `trA` For example, the direction `eng-trA` corresponds to information for reconstructing English text with Turkish speech alignments. Similarly, `enA-jpn` corresponds to "English speech with Japanese text", and `enA-frA` corresponds to "English speech with French speech". Each line has 11 columns. For Audio, the columns correspond to: - `cc_warc`: The warc file reference containing the public audio url - `cc_sha`: not used - `audio_speeh_segment_url`: space separated audio reference. See below. - `cc_lineno`: not used - `paragraph_digest`: expected duration of the whole audio file (without start/end frame trimming) - `sentence_digest`: not used - `text_lid_score`: not used - `laser_score`: score of the alignment - `direction`: direction, e.g. `enA-jpn` - `side`: side, e.g. `enA` or `jpn` - `line_no`: alignment number `audio_speech_segment_url` is a space separated audio reference. It has the following format: ` `, where `start_frame` and `end_frame` correspond to the segment that needs to be extracted from the audio file that is referenced at ``, resampled at 16000 Hz. For text, the columns are similar to NLLB format (except being tab separated here): - If the metadata comes from Common Crawl: - `cc_warc`: the reference to the Common Crawl WET file - `cc_sha`: the document sha1 in the WET file - `cc_document_url`: the url of the document referenced in the WET file - `cc_lineno`: the line number in the document referenced in the WET file - `paragraph_digest`: xxhash.xxh3_64_intdigest of the paragraph - `sentence_digest`: xxhash.xxh3_64_intdigest of the sentence - `text_lid_score`: language identification score, when available - `laser_score`: score of the alignment - `direction`: direction, e.g. `enA-jpn` - `side`: side, e.g. `enA` or `jpn` - `line_no`: alignment number - If the metadata comes from other corpus: - `corpus`: corpus name - `cc_sha`: not used - `cc_document_url`: not used - `lineno`: line number in the document - `paragraph_digest`: xxhash.xxh3_64_intdigest of the paragraph - `sentence_digest`: xxhash.xxh3_64_intdigest of the sentence - `text_lid_score`: language identification score, when available - `laser_score`: score of the alignment - `direction`: direction, e.g. `enA-jpn` - `side`: side, e.g. `enA` or `jpn` - `line_no`: alignment number ## Data Update: 30 Nov 2023 We are publishing an extension of the previous speech to speech release. [afA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.afA-enA.tsv.gz) [amA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.amA-enA.tsv.gz) [arA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.arA-enA.tsv.gz) [asA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.asA-enA.tsv.gz) [azA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.azA-enA.tsv.gz) [beA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.beA-enA.tsv.gz) [bgA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.bgA-enA.tsv.gz) [bnA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.bnA-enA.tsv.gz) [bsA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.bsA-enA.tsv.gz) [caA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.caA-enA.tsv.gz) [csA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.csA-enA.tsv.gz) [cyA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.cyA-enA.tsv.gz) [daA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.daA-enA.tsv.gz) [deA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.deA-enA.tsv.gz) [elA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.elA-enA.tsv.gz) [enA-esA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-esA.tsv.gz) [enA-etA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-etA.tsv.gz) [enA-fiA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-fiA.tsv.gz) [enA-frA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-frA.tsv.gz) [enA-gaA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-gaA.tsv.gz) [enA-glA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-glA.tsv.gz) [enA-guA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-guA.tsv.gz) [enA-heA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-heA.tsv.gz) [enA-hiA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-hiA.tsv.gz) [enA-hrA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-hrA.tsv.gz) [enA-huA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-huA.tsv.gz) [enA-hyA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-hyA.tsv.gz) [enA-idA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-idA.tsv.gz) [enA-isA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-isA.tsv.gz) [enA-itA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-itA.tsv.gz) [enA-jaA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-jaA.tsv.gz) [enA-jvA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-jvA.tsv.gz) [enA-kaA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-kaA.tsv.gz) [enA-kiA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-kiA.tsv.gz) [enA-kkA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-kkA.tsv.gz) [enA-knA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-knA.tsv.gz) [enA-koA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-koA.tsv.gz) [enA-kyA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-kyA.tsv.gz) [enA-lgA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-lgA.tsv.gz) [enA-loA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-loA.tsv.gz) [enA-ltA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-ltA.tsv.gz) [enA-lvA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-lvA.tsv.gz) [enA-mkA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-mkA.tsv.gz) [enA-mlA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-mlA.tsv.gz) [enA-mnA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-mnA.tsv.gz) [enA-mrA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-mrA.tsv.gz) [enA-msA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-msA.tsv.gz) [enA-mtA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-mtA.tsv.gz) [enA-neA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-neA.tsv.gz) [enA-nlA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-nlA.tsv.gz) [enA-noA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-noA.tsv.gz) [enA-orA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-orA.tsv.gz) [enA-paA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-paA.tsv.gz) [enA-pbA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-pbA.tsv.gz) [enA-plA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-plA.tsv.gz) [enA-psA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-psA.tsv.gz) [enA-ptA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-ptA.tsv.gz) [enA-rnA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-rnA.tsv.gz) [enA-ruA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-ruA.tsv.gz) [enA-sdA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-sdA.tsv.gz) [enA-skA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-skA.tsv.gz) [enA-slA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-slA.tsv.gz) [enA-srA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-srA.tsv.gz) [enA-svA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-svA.tsv.gz) [enA-swA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-swA.tsv.gz) [enA-taA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-taA.tsv.gz) [enA-teA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-teA.tsv.gz) [enA-tgA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-tgA.tsv.gz) [enA-thA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-thA.tsv.gz) [enA-trA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-trA.tsv.gz) [enA-ukA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-ukA.tsv.gz) [enA-urA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-urA.tsv.gz) [enA-uzA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-uzA.tsv.gz) [enA-viA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-viA.tsv.gz) [enA-yoA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-yoA.tsv.gz) [enA-zhA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_nov2023_extension/seamless.dataset.metadata.public.enA-zhA.tsv.gz) -------- Update: 25 Sep 2023 We are publishing updated metadata with the expected duration of the original audio file in the column `paragraph_digest` (originally not used for audio). [arb-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.arb-enA.withduration.tsv.gz) [ben-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.ben-enA.withduration.tsv.gz) [cat-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.cat-enA.withduration.tsv.gz) [dan-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.dan-enA.withduration.tsv.gz) [enA-est](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-est.withduration.tsv.gz) [enA-fin](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-fin.withduration.tsv.gz) [enA-jpn](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-jpn.withduration.tsv.gz) [enA-mlt](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-mlt.withduration.tsv.gz) [enA-nld](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-nld.withduration.tsv.gz) [enA-pol](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-pol.withduration.tsv.gz) [enA-por](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-por.withduration.tsv.gz) [enA-ron](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-ron.withduration.tsv.gz) [enA-slk](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-slk.withduration.tsv.gz) [enA-swe](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-swe.withduration.tsv.gz) [enA-swh](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-swh.withduration.tsv.gz) [enA-tur](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-tur.withduration.tsv.gz) [enA-ukr](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-ukr.withduration.tsv.gz) [enA-urd](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-urd.withduration.tsv.gz) [enA-vie](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-vie.withduration.tsv.gz) [arA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.arA-enA.withduration.tsv.gz) [arA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.arA-eng.withduration.tsv.gz) [beA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.beA-enA.withduration.tsv.gz) [caA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.caA-enA.withduration.tsv.gz) [caA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.caA-eng.withduration.tsv.gz) [csA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.csA-enA.withduration.tsv.gz) [csA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.csA-eng.withduration.tsv.gz) [cyA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.cyA-enA.withduration.tsv.gz) [cyA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.cyA-eng.withduration.tsv.gz) [daA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.daA-enA.withduration.tsv.gz) [daA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.daA-eng.withduration.tsv.gz) [deA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.deA-enA.withduration.tsv.gz) [deA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.deA-eng.withduration.tsv.gz) [enA-esA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-esA.withduration.tsv.gz) [enA-fiA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-fiA.withduration.tsv.gz) [enA-frA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-frA.withduration.tsv.gz) [enA-hiA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-hiA.withduration.tsv.gz) [enA-idA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-idA.withduration.tsv.gz) [enA-itA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-itA.withduration.tsv.gz) [enA-knA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-knA.withduration.tsv.gz) [enA-koA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-koA.withduration.tsv.gz) [enA-mtA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-mtA.withduration.tsv.gz) [enA-nlA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-nlA.withduration.tsv.gz) [enA-plA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-plA.withduration.tsv.gz) [enA-ptA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-ptA.withduration.tsv.gz) [enA-rnA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-rnA.withduration.tsv.gz) [enA-ruA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-ruA.withduration.tsv.gz) [enA-skA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-skA.withduration.tsv.gz) [enA-svA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-svA.withduration.tsv.gz) [enA-swA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-swA.withduration.tsv.gz) [enA-taA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-taA.withduration.tsv.gz) [enA-teA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-teA.withduration.tsv.gz) [enA-tgA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-tgA.withduration.tsv.gz) [enA-thA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-thA.withduration.tsv.gz) [enA-trA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-trA.withduration.tsv.gz) [enA-ukA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-ukA.withduration.tsv.gz) [enA-urA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-urA.withduration.tsv.gz) [enA-uzA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-uzA.withduration.tsv.gz) [enA-viA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-viA.withduration.tsv.gz) [enA-zhA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-zhA.withduration.tsv.gz) [eng-esA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-esA.withduration.tsv.gz) [eng-fiA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-fiA.withduration.tsv.gz) [eng-frA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-frA.withduration.tsv.gz) [eng-hiA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-hiA.withduration.tsv.gz) [eng-idA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-idA.withduration.tsv.gz) [eng-itA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-itA.withduration.tsv.gz) [eng-knA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-knA.withduration.tsv.gz) [eng-koA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-koA.withduration.tsv.gz) [eng-mtA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-mtA.withduration.tsv.gz) [eng-nlA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-nlA.withduration.tsv.gz) [eng-plA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-plA.withduration.tsv.gz) [eng-ptA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-ptA.withduration.tsv.gz) [eng-rnA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-rnA.withduration.tsv.gz) [eng-ruA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-ruA.withduration.tsv.gz) [eng-skA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-skA.withduration.tsv.gz) [eng-swA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-swA.withduration.tsv.gz) [eng-taA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-taA.withduration.tsv.gz) [eng-teA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-teA.withduration.tsv.gz) [eng-tgA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-tgA.withduration.tsv.gz) [eng-thA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-thA.withduration.tsv.gz) [eng-trA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-trA.withduration.tsv.gz) [eng-ukA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-ukA.withduration.tsv.gz) [eng-urA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-urA.withduration.tsv.gz) [eng-uzA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-uzA.withduration.tsv.gz) [eng-viA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-viA.withduration.tsv.gz) [eng-zhA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-zhA.withduration.tsv.gz) -------- You can find the legacy metadata (without duration information) here: ### Legacy Data [arb-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.arb-enA.tsv.gz) [ben-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.ben-enA.tsv.gz) [cat-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.cat-enA.tsv.gz) [dan-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.dan-enA.tsv.gz) [enA-est](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-est.tsv.gz) [enA-fin](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-fin.tsv.gz) [enA-jpn](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-jpn.tsv.gz) [enA-mlt](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-mlt.tsv.gz) [enA-nld](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-nld.tsv.gz) [enA-pol](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-pol.tsv.gz) [enA-por](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-por.tsv.gz) [enA-ron](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-ron.tsv.gz) [enA-slk](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-slk.tsv.gz) [enA-swe](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-swe.tsv.gz) [enA-swh](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-swh.tsv.gz) [enA-tur](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-tur.tsv.gz) [enA-ukr](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-ukr.tsv.gz) [enA-urd](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-urd.tsv.gz) [enA-vie](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-vie.tsv.gz) [arA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.arA-enA.tsv.gz) [arA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.arA-eng.tsv.gz) [beA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.beA-enA.tsv.gz) [caA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.caA-enA.tsv.gz) [caA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.caA-eng.tsv.gz) [csA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.csA-enA.tsv.gz) [csA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.csA-eng.tsv.gz) [cyA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.cyA-enA.tsv.gz) [cyA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.cyA-eng.tsv.gz) [daA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.daA-enA.tsv.gz) [daA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.daA-eng.tsv.gz) [deA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.deA-enA.tsv.gz) [deA-eng](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.deA-eng.tsv.gz) [enA-esA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-esA.tsv.gz) [enA-fiA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-fiA.tsv.gz) [enA-frA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-frA.tsv.gz) [enA-hiA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-hiA.tsv.gz) [enA-idA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-idA.tsv.gz) [enA-itA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-itA.tsv.gz) [enA-knA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-knA.tsv.gz) [enA-koA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-koA.tsv.gz) [enA-mtA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-mtA.tsv.gz) [enA-nlA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-nlA.tsv.gz) [enA-plA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-plA.tsv.gz) [enA-ptA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-ptA.tsv.gz) [enA-rnA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-rnA.tsv.gz) [enA-ruA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-ruA.tsv.gz) [enA-skA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-skA.tsv.gz) [enA-svA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-svA.tsv.gz) [enA-swA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-swA.tsv.gz) [enA-taA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-taA.tsv.gz) [enA-teA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-teA.tsv.gz) [enA-tgA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-tgA.tsv.gz) [enA-thA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-thA.tsv.gz) [enA-trA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-trA.tsv.gz) [enA-ukA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-ukA.tsv.gz) [enA-urA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-urA.tsv.gz) [enA-uzA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-uzA.tsv.gz) [enA-viA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-viA.tsv.gz) [enA-zhA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.enA-zhA.tsv.gz) [eng-esA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-esA.tsv.gz) [eng-fiA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-fiA.tsv.gz) [eng-frA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-frA.tsv.gz) [eng-hiA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-hiA.tsv.gz) [eng-idA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-idA.tsv.gz) [eng-itA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-itA.tsv.gz) [eng-knA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-knA.tsv.gz) [eng-koA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-koA.tsv.gz) [eng-mtA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-mtA.tsv.gz) [eng-nlA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-nlA.tsv.gz) [eng-plA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-plA.tsv.gz) [eng-ptA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-ptA.tsv.gz) [eng-rnA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-rnA.tsv.gz) [eng-ruA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-ruA.tsv.gz) [eng-skA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-skA.tsv.gz) [eng-swA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-swA.tsv.gz) [eng-taA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-taA.tsv.gz) [eng-teA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-teA.tsv.gz) [eng-tgA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-tgA.tsv.gz) [eng-thA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-thA.tsv.gz) [eng-trA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-trA.tsv.gz) [eng-ukA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-ukA.tsv.gz) [eng-urA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-urA.tsv.gz) [eng-uzA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-uzA.tsv.gz) [eng-viA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-viA.tsv.gz) [eng-zhA](https://dl.fbaipublicfiles.com/seamless/data/seamless.dataset.metadata.public.eng-zhA.tsv.gz) ## Download script You can use the `wet_lines` script to download and gather aligned text information from the metadata. This script can be found [here](https://github.com/kpu/preprocess/blob/wet/preprocess/wet_lines_main.cc). ### Example usage: `zcat seamless.dataset.metadata.public.enA-swA.tsv.gz | egrep ^crawl-data | tr '\t' ' ' | wet_lines` Based on metadata information it receives from stdin, wet_lines will download the corpora, find the paragraph and print the input with an additional column which corresponds to the text of the paragraph. In order to retrieve the sentences from these paragraphs, one can use the sentence splitter available [here](https://github.com/facebookresearch/LASER/tree/main/utils). It will print the input (metadata + paragraph) with an additional column which corresponds to the text of the sentence. ### Reconstructing sentences from metadata: `xzcat metadatafile.xz | egrep ^crawl-data | wet_lines | python -c "from sentence_cleaner_splitter.cleaner_splitter import *; split_clean()"` --- ## File: docs/m4t/unity2_aligner_README.md # UnitY2 forced alignment extractor Please refer to Section 3.3.2 of the "Seamless: Multilingual Expressive and Streaming Speech Translation" paper to read more details about aligner design & training. We provide a light-weight wrapper to extract alignments between given text and acoustic unit sequences. Unit extractor is also available from the wrapper itself. ## Alignment extractor codebase The entire codebase is located in `/src/seamless_communication/models/aligner`. It is built using fairseq2 library. This time we release a mutlilingual (38 languages following SeamlessM4Tv2 target languages) checkpoint to load the alignment toolkit. This checkpoint corresponds to `nar_t2u_aligner` asset card. ## Usage examples For large-scale alignment extraction offline unit extraction is preferred. Refer to `/src/seamless_communication/cli/m4t/audio_to_units` for more details on offline unit extraction. **Alignment extractor initialization:** ```python from seamless_communication.models.aligner.alignment_extractor import AlignmentExtractor from fairseq2.typing import Device import torch extractor = AlignmentExtractor( aligner_model_name_or_card="nar_t2u_aligner", unit_extractor_model_name_or_card="xlsr2_1b_v2", unit_extractor_output_layer=35, unit_extractor_kmeans_model_uri="https://dl.fbaipublicfiles.com/seamlessM4T/models/unit_extraction/kmeans_10k.npy", ) ``` * large unit extractor checkpoint will be downloaded, this takes time * by default cpu device is used, but fp16 (`dtype=torch.float16`) & cuda (`device=Device("cuda")`) are supported, see class constructor for details **Extracting alignment** Ru audio example: * audio link: `https://models.silero.ai/denoise_models/sample0.wav` (thanks Silero team for public audio samples) * ru_transcription: `первое что меня поразило это необыкновенно яркий солнечный свет похожий на электросварку` ```python alignment_durations, _, tokenized_text_tokens = extractor.extract_alignment("sample0.wav", ru_transcription, plot=True, add_trailing_silence=True) ``` * audio will be resampled to 16kHz for unit extraction * `alignment_durations` contains number of units (20ms frames) aligned per each token from `tokenized_text_tokens`. * `add_trailing_silence` sets extra silence token in the end of the given text sequence. That is useful when there is no terminal punctuation provided in the text itself. Ru alignment plot: En audio example: * audio link: `https://dl.fbaipublicfiles.com/seamlessM4T/LJ037-0171_sr16k.wav` * en_transcription: `the examination and testimony of the experts enabled the commision to conclude that five shots may have been fired.` ```python alignment_durations, _, tokenized_text_tokens = extractor.extract_alignment("LJ037-0171_sr16k.wav", en_transcription, plot=True, add_trailing_silence=False) ``` * here we set `add_trailing_silence` to False since terminal punctuation exists, but True will also work En alignment plot: ## Integration test If you encounter issues with produced alignments, please run integration test with the alignment extraction toolkit to make sure that your environment works good. Run from the repo root: `pytest -vv tests/integration/models/test_unity2_aligner.py` --- ## File: docs/expressive/README.md # SeamlessExpressive SeamlessExpressive model consists of two main modules: (1) Prosody UnitY2, which is a prosody-aware speech-to-unit translation model based on UnitY2 architecture; and (2) PRETSSEL, which is a unit-to-speech model featuring cross-lingual expressivity preservation. ## Prosody UnitY2 Prosody UnitY2 is an expressive speech-to-unit translation model, injecting expressivity embedding from PRETSSEL into the unit generation. It could transfer phrase-level prosody such as speech rate or pauses. ## PRETSSEL **P**aralinguistic **RE**presentation-based **T**extle**SS** acoustic mod**EL** (PRETSSEL) is an expressive unit-to-speech generator, and it can efficiently disentangle semantic and expressivity components from speech. It transfers utterance-level expressivity like the style of one's voice. # Benchmark Datasets ## mExpresso (Multilingual Expresso) mExpresso is an expressive S2ST dataset that includes seven styles of read speech (i.e., default, happy, sad, confused, enunciated, whisper and laughing) between English and five other languages -- French, German, Italian, Mandarin and Spanish. We create the dataset by expanding a subset of read speech in [Expresso Dataset](https://github.com/facebookresearch/textlesslib/tree/main/examples/expresso/dataset). We first translate the English transcriptions into other languages, including the emphasis markers in the transcription, and then the gender matched bilingual speakers read the translation in the style suggested by the markers. We are currently open source the text translation of the other language to enable evaluating English to other directions. We will open source the audio files in the near future. Text translation in other languages can be [Downloaded](https://dl.fbaipublicfiles.com/seamless/datasets/mexpresso_text/mexpresso_text.tar). ### Statistics of mExpresso | language pair | subset | # items | English duration (hr) | # speakers | |---------------|--------|---------|-----------------------|------------| |eng-cmn| dev | 2369 | 2.1 | 1 | | | test | 5003 | 4.8 | 2 | |eng-deu| dev | 4420 | 3.9 | 2 | | | test | 5733 | 5.6 | 2 | |eng-fra| dev | 4770 | 4.2 | 2 | | | test | 5742 | 5.6 | 2 | |eng-ita| dev | 4413 | 3.9 | 2 | | | test | 5756 | 5.7 | 2 | |eng-spa| dev | 4758 | 4.2 | 2 | | | test | 5693 | 5.5 | 2 | ### Create mExpresso S2T dataset by downloading and combining with English Expresso Run the following command to create English to other langauges speech-to-text dataset from scratch. It will first download the English Expresso dataset, downsample the audio to 16k Hz, and join with the text translation to form the manifest. ```python python3 -m seamless_communication.cli.expressivity.data.prepare_mexpresso \ ``` The output manifest will be located at `/{dev,test}_mexpresso_eng_{spa,fra,deu,ita,cmn}.tsv` # Automatic evaluation Python package dependencies (on top of seamless_communication, coming from stopes pipelines): * Unidecode * scipy * phonemizer * s3prl * syllables * ipapy * pkuseg * nltk * fire * inflect ```bash pip install Unidecode scipy phonemizer s3prl syllables ipapy pkuseg nltk fire inflect ``` As described in Section 4.3 we use following automatic metrics: 1. **ASR-BLEU**: refer to `/src/seamless_communication/cli/eval_utils` to see how the OpenAI whisper ASR model is used to extract transcriptions from generated audios. 2. **Vocal Style Similarity**: refer to [stopes/eval/vocal_style_similarity](https://github.com/facebookresearch/stopes/tree/main/stopes/eval/vocal_style_similarity) for implementation details. 3. **AutoPCP**: refer to [stopes/eval/auto_pcp](https://github.com/facebookresearch/stopes/tree/main/stopes/eval/auto_pcp) for implementation details. 4. **Pause and Rate scores**: refer to [stopes/eval/local_prosody](https://github.com/facebookresearch/stopes/tree/main/stopes/eval/local_prosody) for implementation details. Rate score corresponds to the syllable speech rate spearman correlation between source and predicted speech. Pause score corresponds to the weighted mean joint score produced by `stopes/eval/local_prosody/compare_utterances.py` script from stopes repo. ## Evaluation results: mExpresso Please see [mExpresso section](#mexpresso-multilingual-expresso) on how to download evaluation data *Important Notes*: * We used empirically chosen duration factors per each tgt language towards the best perceptual quality: 1.0 (default) for cmn, spa, ita; 1.1 for deu; 1.2 for fra. Same settings were used to report results in the "Seamless: Multilingual Expressive and Streaming Speech Translation" paper. * Results here slightly differs from ones shown in the paper due to several descrepancies in the pipeline: results reported here use pipeline w/ fairseq2 backend for model's inference and pipeline includes watermarking. | Language | Partition | ASR-BLEU | Vocal Style Sim | AutoPCP | Pause | Rate | |----------|-----------|----------|-------------|---------|-------|------| | eng_cmn | dev | 26.080 | 0.207 | 3.168 | 0.236 | 0.538 | | eng_deu | dev | 36.940 | 0.261 | 3.298 | 0.319 | 0.717 | | eng_fra | dev | 37.780 | 0.231 | 3.285 | 0.331 | 0.682 | | eng_ita | dev | 40.170 | 0.226 | 3.322 | 0.388 | 0.734 | | eng_spa | dev | 42.400 | 0.228 | 3.379 | 0.332 | 0.702 | | eng_cmn | test | 23.320 | 0.249 | 2.984 | 0.385 | 0.522 | | eng_deu | test | 27.780 | 0.290 | 3.117 | 0.483 | 0.717 | | eng_fra | test | 38.360 | 0.270 | 3.117 | 0.506 | 0.663 | | eng_ita | test | 38.020 | 0.274 | 3.130 | 0.523 | 0.686 | | eng_spa | test | 42.920 | 0.274 | 3.183 | 0.508 | 0.675 | ### Step-by-step evaluation Pre-requisite: all steps described here assume that the generation/inference has been completed following [steps](../../README.md#seamlessexpressive-inference). For stopes installation please refer to [stopes/eval](https://github.com/facebookresearch/stopes/tree/main/stopes/eval). The resulting directory of generated outputs: ```bash export SPLIT="dev_mexpresso_eng_spa" # example, change for your split export TGT_LANG="spa" export SRC_LANG="eng" export GENERATED_DIR="path_to_generated_output_for_given_data_split" export GENERATED_TSV="generate-${SPLIT}.tsv" export STOPES_ROOT="path_to_stopes_code_repo" export SC_ROOT="path_to_this_repo" ``` **ASR-BLEU evaluation** ```bash python ${SC_ROOT}/src/seamless_communication/cli/expressivity/evaluate/run_asr_bleu.py \ --generation_dir_path=${GENERATED_DIR} \ --generate_tsv_filename=generate-${SPLIT}.tsv \ --tgt_lang=${TGT_LANG} ``` * `generate-${SPLIT}.tsv` is an expected output from inference described in pre-requisite After completion resulting ASR-BLEU score is written in `${GENERATED_DIR}/s2st_asr_bleu_normalized.json`. **Vocal Style Similarity** Download & set WavLM finetuned ckpt path (`${SPEECH_ENCODER_MODEL_PATH}`) as described in [stopes README](https://github.com/facebookresearch/stopes/tree/main/stopes/eval/vocal_style_similarity#pre-requisites) to reproduce our vocal style similarity eval. ```bash python -m stopes.modules +vocal_style_similarity=base \ launcher.cluster=local \ vocal_style_similarity.model_type=valle \ +vocal_style_similarity.model_path=${SPEECH_ENCODER_MODEL_PATH} \ +vocal_style_similarity.input_file=${GENERATED_DIR}/${GENERATED_TSV} \ +vocal_style_similarity.output_file=${GENERATED_DIR}/vocal_style_sim_result.txt \ vocal_style_similarity.named_columns=true \ vocal_style_similarity.src_audio_column=src_audio \ vocal_style_similarity.tgt_audio_column=hypo_audio ``` * We report average number from all utterance scores written in `${GENERATED_DIR}/vocal_style_sim_result.txt`. **AutoPCP** ```bash python -m stopes.modules +compare_audios=AutoPCP_multilingual_v2 \ launcher.cluster=local \ +compare_audios.input_file=${GENERATED_DIR}/${GENERATED_TSV} \ compare_audios.src_audio_column=src_audio \ compare_audios.tgt_audio_column=hypo_audio \ +compare_audios.named_columns=true \ +compare_audios.output_file=${GENERATED_DIR}/autopcp_result.txt ``` * We report average number from all utterance scores written in `${GENERATED_DIR}/autopcp_result.txt`. **Pause and Rate** This stage includes 3 steps: (1) src lang annotation, (2) tgt lang annotation, (3) pairwise comparison ```bash # src lang pause&rate annotation python ${STOPES_ROOT}/stopes/eval/local_prosody/annotate_utterances.py \ +data_path=${GENERATED_DIR}/${GENERATED_TSV} \ +result_path=${GENERATED_DIR}/${SRC_LANG}_speech_rate_pause_annotation.tsv \ +audio_column=src_audio \ +text_column=src_text \ +speech_units=[syllable] \ +vad=true \ +net=true \ +lang=$SRC_LANG \ +forced_aligner=fairseq2_nar_t2u_aligner # tgt lang pause&rate annotation python ${STOPES_ROOT}/stopes/eval/local_prosody/annotate_utterances.py \ +data_path=${GENERATED_DIR}/${GENERATED_TSV} \ +result_path=${GENERATED_DIR}/${TGT_LANG}_speech_rate_pause_annotation.tsv \ +audio_column=hypo_audio \ +text_column=s2t_out \ +speech_units=[syllable] \ +vad=true \ +net=true \ +lang=$TGT_LANG \ +forced_aligner=fairseq2_nar_t2u_aligner # pair wise comparison python ${STOPES_ROOT}/stopes/eval/local_prosody/compare_utterances.py \ +src_path=${GENERATED_DIR}/${SRC_LANG}_speech_rate_pause_annotation.tsv \ +tgt_path=${GENERATED_DIR}/${TGT_LANG}_speech_rate_pause_annotation.tsv \ +result_path=${GENERATED_DIR}/${SRC_LANG}_${TGT_LANG}_pause_scores.tsv \ +pause_min_duration=0.1 ``` * For Rate reporting, please see the aggregation function `get_rate` in `${SC_ROOT}/src/seamless_communication/cli/expressivity/evaluate/post_process_pauserate.py`; * For Pause reporting, please see the aggregation function `get_pause` in `${SC_ROOT}/src/seamless_communication/cli/expressivity/evaluate/post_process_pauserate.py`. --- ## File: docs/expressive/seamless_align_expressive_README.md # SeamlessAlignExpressive Building upon our past work with WikiMatrix, CCMatrix, NLLB, SpeechMatrix and SeamlessM4T, we’re introducing the first expressive speech alignment procedure. Starting with raw data, the expressive alignment procedure automatically discovers pairs of audio segments sharing not only the same meaning, but the same overall expressivity. To showcase this procedure, we are making metadata available to create a benchmarking dataset called SeamlessAlignExpressive, that can be used to validate the quality of our alignment method. SeamlessAlignExpressive is the first large-scale collection of multilingual audio alignments for expressive translation for benchmarking. ## Format The metadata files are space separated, gzip files. Each file corresponds to one alignment direction. File naming convention: we use 2 letters with an 'A': e.g. `frA`, `enA`, `deA`. For example, the direction `deA-enA` corresponds to information for reconstructing German speech to English speech alignments. Each line has 9 columns. The columns correspond to: - `direction`: direction, e.g. `enA-deA` - `side`: side, e.g. `enA` or `deA` - `line_no`: alignment number - `cc_warc`: The public CC warc file reference containing the public audio url - `duration`: original file duration - `audio_speech_segment_url`: public audio reference - `audio_speech_start_frame`: start frame when the audio is resampled at 16kHz - `audio_speech_end_frame`: end frame when the audio is resampled at 16kHz - `laser_score`: score of the alignment ## Data [deA-enA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_expressive/seamless.dataset.metadata.public.deA-enA.tsv.gz) [enA-esA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_expressive/seamless.dataset.metadata.public.enA-esA.tsv.gz) [enA-frA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_expressive/seamless.dataset.metadata.public.enA-frA.tsv.gz) [enA-itA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_expressive/seamless.dataset.metadata.public.enA-itA.tsv.gz) [enA-zhA](https://dl.fbaipublicfiles.com/seamless/data/seamless_align_expressive/seamless.dataset.metadata.public.enA-zhA.tsv.gz) --- ## File: ggml/examples/python/README.md # Simple autogenerated Python bindings for ggml This folder contains: - Scripts to generate full Python bindings from ggml headers (+ stubs for autocompletion in IDEs) - Some barebones utils (see [ggml/utils.py](./ggml/utils.py)): - `ggml.utils.init` builds a context that's freed automatically when the pointer gets GC'd - `ggml.utils.copy` **copies between same-shaped tensors (numpy or ggml), w/ automatic (de/re)quantization** - `ggml.utils.numpy` returns a numpy view over a ggml tensor; if it's quantized, it returns a copy (requires `allow_copy=True`) - Very basic examples (anyone wants to port [llama2.c](https://github.com/karpathy/llama2.c)?) Provided you set `GGML_LIBRARY=.../path/to/libggml_shared.so` (see instructions below), it's trivial to do some operations on quantized tensors: ```python # Make sure libllama.so is in your [DY]LD_LIBRARY_PATH, or set GGML_LIBRARY=.../libggml_shared.so from ggml import lib, ffi from ggml.utils import init, copy, numpy import numpy as np ctx = init(mem_size=12*1024*1024) n = 256 n_threads = 4 a = lib.ggml_new_tensor_1d(ctx, lib.GGML_TYPE_Q5_K, n) b = lib.ggml_new_tensor_1d(ctx, lib.GGML_TYPE_F32, n) # Can't both be quantized sum = lib.ggml_add(ctx, a, b) # all zeroes for now. Will be quantized too! gf = ffi.new('struct ggml_cgraph*') lib.ggml_build_forward_expand(gf, sum) copy(np.array([i for i in range(n)], np.float32), a) copy(np.array([i*100 for i in range(n)], np.float32), b) lib.ggml_graph_compute_with_ctx(ctx, gf, n_threads) print(numpy(a, allow_copy=True)) # 0. 1.0439453 2.0878906 3.131836 4.1757812 5.2197266. ... print(numpy(b)) # 0. 100. 200. 300. 400. 500. ... print(numpy(sum, allow_copy=True)) # 0. 105.4375 210.875 316.3125 421.75 527.1875 ... ``` ### Prerequisites You'll need a shared library of ggml to use the bindings. #### Build libggml_shared.so or libllama.so As of this writing the best is to use [ggerganov/llama.cpp](https://github.com/ggerganov/llama.cpp)'s generated `libggml_shared.so` or `libllama.so`, which you can build as follows: ```bash git clone https://github.com/ggerganov/llama.cpp # On a CUDA-enabled system add -DLLAMA_CUBLAS=1 # On a Mac add -DLLAMA_METAL=1 cmake llama.cpp \ -B llama_build \ -DCMAKE_C_FLAGS=-Ofast \ -DLLAMA_NATIVE=1 \ -DLLAMA_LTO=1 \ -DBUILD_SHARED_LIBS=1 \ -DLLAMA_MPI=1 \ -DLLAMA_BUILD_TESTS=0 \ -DLLAMA_BUILD_EXAMPLES=0 ( cd llama_build && make -j ) # On Mac, this will be libggml_shared.dylib instead export GGML_LIBRARY=$PWD/llama_build/libggml_shared.so # Alternatively, you can just copy it to your system's lib dir, e.g /usr/local/lib ``` #### (Optional) Regenerate the bindings and stubs If you added or changed any signatures of the C API, you'll want to regenerate the bindings ([ggml/cffi.py](./ggml/cffi.py)) and stubs ([ggml/__init__.pyi](./ggml/__init__.pyi)). Luckily it's a one-liner using [regenerate.py](./regenerate.py): ```bash pip install -q cffi python regenerate.py ``` By default it assumes `llama.cpp` was cloned in ../../../llama.cpp (alongside the ggml folder). You can override this with: ```bash C_INCLUDE_DIR=$LLAMA_CPP_DIR python regenerate.py ``` You can also edit [api.h](./api.h) to control which files should be included in the generated bindings (defaults to `llama.cpp/ggml*.h`) In fact, if you wanted to only generate bindings for the current version of the `ggml` repo itself (instead of `llama.cpp`; you'd loose support for k-quants), you could run: ```bash API=../../include/ggml/ggml.h python regenerate.py ``` ## Develop Run tests: ```bash pytest ``` ### Alternatives This example's goal is to showcase [cffi](https://cffi.readthedocs.io/)-generated bindings that are trivial to use and update, but there are already alternatives in the wild: - https://github.com/abetlen/ggml-python: these bindings seem to be hand-written and use [ctypes](https://docs.python.org/3/library/ctypes.html). It has [high-quality API reference docs](https://ggml-python.readthedocs.io/en/latest/api-reference/#ggml.ggml) that can be used with these bindings too, but it doesn't expose Metal, CUDA, MPI or OpenCL calls, doesn't support transparent (de/re)quantization like this example does (see [ggml.utils](./ggml/utils.py) module), and won't pick up your local changes. - https://github.com/abetlen/llama-cpp-python: these expose the C++ `llama.cpp` interface, which this example cannot easily be extended to support (`cffi` only generates bindings of C libraries) - [pybind11](https://github.com/pybind/pybind11) and [nanobind](https://github.com/wjakob/nanobind) are two alternatives to cffi that support binding C++ libraries, but it doesn't seem either of them have an automatic generator (writing bindings is rather time-consuming). --- ## File: ggml/README.md # unity.cpp ## Introduction [GGML](https://github.com/ggerganov/ggml) is an open source library in C to enable large model inference on various hardware platforms. We implemented unity.cpp in ggml. Now it supports SeamlessM4T model for X2T tasks - Speech-to-text translation (S2TT), Acoustic speech recognition (ASR), Text-to-text translation (T2TT). The project is still active in development. Contributions are welcome! ## Build To build the interactive console for S2TT & ASR & T2TT, ``` cd seamless_communication/ggml mkdir build; cd build cmake -DGGML_OPENBLAS=ON \ -DBUILD_SHARED_LIBS=On \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS="-g2 -fno-omit-frame-pointer" \ .. make -j4 unity # Interactive Console ``` For more build commands see [Makefile](Makefile). ## CLI usage ### S2TT Command to launch an interactive console for S2TT & ASR, note that the model already includes vocabulary needed to detokenize. ``` OPENBLAS_NUM_THREADS=8 ./bin/unity --model seamlessM4T_medium.ggml ``` In the console, enter "wav_file tgt_lang" - the path of local waveform file and target language, separated by space. Note that the first run would include some “warm up” time so could be slow. ### T2TT Launching command: ``` OPENBLAS_NUM_THREADS=8 ./bin/unity --model nllb-200_dense_1b.ggml --text ``` In the console, enter "input_text tgt_lang" - input text and target langauge, separated by space. Note that the language code should align with [NLLB BCP-47 code](https://github.com/facebookresearch/flores/blob/main/flores200/README.md#languages-in-flores-200), NOT 3-letter language code as S2TT task with Seamless. Unifying this is on todo list. ### Model downloads Converted ggml models could be downloaded from |SeamlessM4T_large | SeamlessM4T_medium | NLLB_dense_1b | NLLB_distill_600m | |-------- | -------- | ------- | ------- | | [model](dl.fbaipublicfiles.com/seamless/models/seamlessM4T_large.ggml) | [model](dl.fbaipublicfiles.com/seamless/models/seamlessM4T_medium.ggml) | [model](dl.fbaipublicfiles.com/seamless/models/nllb-200_dense_1b.ggml) | [model](dl.fbaipublicfiles.com/seamless/models/nllb-200_dense_distill_600m.ggml) For more details of NLLB models, please check https://github.com/facebookresearch/fairseq/tree/nllb. ## Fairseq2 model conversion Models from fairseq2 checkpoints could be converted to ggml automatically with [ggml_convert.py](ggml_convert.py). ``` python ggml_convert.py -m MODEL_NAME ``` where MODEL_NAME corresponds to asset cards in fairseq2 / seamless_communication, e.g. seamlessM4T_medium, seamlessM4T_large ## Python bindings We also utilize ggml python bindings for better dev experience. For examples of running unity.cpp in python, refer to tests in [test_unity_cpp.py](test_unity_cpp.py). ## [Optional]Dependencies ### OpenBLAS We strongly suggest building with OpenBLAS, as we've seen 8x speedup on test machine. ### libsndfile This is needed only for the console to load waveform, but not the library.