Downloads · 30 days
13
23% of all-time downloads
Estonel/turnlet-bert-multilingual-eou
turnlet-bert-multilingual-eou is a machine learning model from Estonel. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A lightweight, multilingual DistilBERT model fine-tuned for End-of-Utterance (EOU) detection in conversational AI systems. This model supports English, Hindi, and Spanish with high accuracy and fast inference.
Downloads · 30 days
13
23% of all-time downloads
All-time downloads
57
Public
Parameters
135M
3.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.onnx679 MB · 55%
From the Hugging Face model README
A lightweight, multilingual DistilBERT model fine-tuned for End-of-Utterance (EOU) detection in conversational AI systems. This model supports English, Hindi, and Spanish with high accuracy and fast inference.
| Language | Accuracy | Samples |
|---|---|---|
| English | 97.01% | 16,258 |
| Hindi | 96.89% | 12,103 |
| Spanish | 94.52% | 7,963 |
| Overall | 96.43% | 36,324 |
Validation Metrics:
This repository includes three model formats:
model.safetensors - Full precision PyTorch modelbert_model_optimized.onnx - Optimized for inference, full precisionbert_model_optimized_dynamic_int8.onnx - Recommended for production# Clone the model repository
git clone https://huggingface.co/your-username/turnlet-bert-multilingual-eou
cd turnlet-bert-multilingual-eou
# Install dependencies
pip install -r requirements.txt
# Run interactive mode (default - uses fast ONNX INT8)
python inference_example.py
# Or explicitly use interactive mode
python inference_example.py --interactive
# Use PyTorch instead of ONNX
python inference_example.py --interactive --pytorch
# Adjust threshold
python inference_example.py --interactive --threshold 0.9
The interactive mode allows you to:
# Single prediction with ONNX (fast)
python inference_example.py --text "Thanks for your help!"
# Test suite with multiple examples
python inference_example.py --test-suite
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
model = AutoModelForSequenceClassification.from_pretrained("your-username/turnlet-bert-multilingual-eou")
tokenizer = AutoTokenizer.from_pretrained("your-username/turnlet-bert-multilingual-eou")
# Predict
text = "Thanks for your help!"
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=128)
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=-1)
is_eou = probs[0][1] > 0.5 # Using optimal threshold
print(f"EOU Probability: {probs[0][1]:.3f}")
print(f"Is EOU: {is_eou}")
import onnxruntime as ort
import numpy as np
from transformers import AutoTokenizer
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("your-username/turnlet-bert-multilingual-eou")
# Create ONNX session
session = ort.InferenceSession("bert_model_optimized_dynamic_int8.onnx")
# Tokenize
text = "Thanks for your help!"
inputs = tokenizer(text, padding="max_length", max_length=128, truncation=True, return_tensors="np")
# Prepare ONNX inputs
ort_inputs = {
'input_ids': inputs['input_ids'].astype(np.int64),
'attention_mask': inputs['attention_mask'].astype(np.int64)
}
# Run inference
outputs = session.run(None, ort_inputs)
logits = outputs[0][0]
# Calculate probability
probs = np.exp(logits) / np.sum(np.exp(logits))
is_eou = probs[1] > 0.5 # Using optimal threshold
print(f"EOU Probability: {probs[1]:.3f}")
print(f"Is EOU: {is_eou}")
This model is designed for:
The model was trained using knowledge distillation on a multilingual dataset:
The model was created using sparse Mixture-of-Experts (MoE) based knowledge distillation:
The model was evaluated on:
Approximate inference times (CPU, single sample):
Note: Actual speeds vary by hardware
If you use this model in your research or applications, please cite:
@model{turnlet-bert-multilingual-eou,
title={Turnlet BERT Multilingual: End-of-Utterance Detection},
author={Your Name},
year={2024},
publisher={Hugging Face},
note={Knowledge-distilled DistilBERT for multilingual EOU detection}
}
Please specify your license here (e.g., Apache 2.0, MIT, etc.)
For questions or feedback, please open an issue in the repository.
Model Version: Step 60500
Last Updated: November 2024
Framework: PyTorch, ONNX Runtime
Languages: English (en), Hindi (hi), Spanish (es)