Downloads · 30 days
0
N03N9/mms-1b-ll-lid-timestamp
mms-1b-ll-lid-timestamp is a audio classification model from N03N9. Use it for the audio classification task on the model card, and read the license before you ship it in a product. It is set up for mms-lid. The card lists the license as cc-by-nc-4.0.
This model is a robust Language Identification (LID) system based on Meta's MMS-1B (wav2vec2) architecture. It identifies 19 languages + Silence using Frame-wise Cross Entropy Loss and employs a Viterbi Decoder for st…
Downloads · 30 days
0
Access
Public
Updated Dec 9, 2025
Repo size
5.8 GB
Likes
1
Public
Click a slice to open those files.
.pth5.8 GB · 100%
From the Hugging Face model README
This model is a robust Language Identification (LID) system based on Meta's MMS-1B (wav2vec2) architecture. It identifies 19 languages + Silence using Frame-wise Cross Entropy Loss and employs a Viterbi Decoder for stable, smoothed timestamp generation.
Unlike standard classification models that suffer from "flickering" (rapidly switching languages), this model uses a transition penalty (probability shift) to enforce segment continuity. This makes it ideal for Code-Switching detection, Speech Segmentation, and ASR preprocessing.
facebook/mms-1b-fl102 (Frozen feature extractor + Trainable top layers)You can install the inference package via PyPI:
pip install mms-lid
Note: Requires Python 3.8+ and PyTorch 2.0+.
The model weights will be automatically downloaded from this Hugging Face repository upon the first execution.
Use the LIDPipeline class to process audio files or tensors directly in your Python code.
from mms_lid import LIDPipeline
# Initialize Pipeline
# (Downloads the model automatically to ./weights/ on the first run)
pipeline = LIDPipeline()
# Predict (Supports file path or torch tensor)
audio_path = "path/to/your/audio.wav"
segments = pipeline.predict(audio_path)
# Print Results
print(f"{'Start':<8} | {'End':<8} | {'Language'}")
print("-" * 30)
for seg in segments:
print(f"{seg['start']:<8.2f} | {seg['end']:<8.2f} | {seg['label']}")
You can also use the terminal command mms_lid to process files and save results to JSON.
# Basic usage
mms_lid input.wav --output result.json
# Specify a custom model path (optional)
mms_lid input.wav --model_path ./my_model.pth
Output format (JSON):
[
{
"label": "ko",
"start": 0.0,
"end": 4.22,
"id": 0
},
{
"label": "en",
"start": 4.22,
"end": 8.50,
"id": 1
}
]
The model distinguishes between Silence and the following 19 languages:
| Code | Language | Code | Language | Code | Language |
|---|---|---|---|---|---|
ko | Korean | en | English | ja | Japanese |
zh | Chinese | fr | French | de | German |
es | Spanish | it | Italian | pt | Portuguese |
ru | Russian | ar | Arabic | hi | Hindi |
tr | Turkish | ms | Malay | da | Danish |
fi | Finnish | nl | Dutch | no | Norwegian |
sv | Swedish | <silence> | Non-speech |
This model does not use simple argmax. Instead, it uses Viterbi decoding with a transition scale parameter.
This project is licensed under the CC-BY-NC 4.0 License. Based on Meta's MMS Model (CC-BY-NC 4.0).