Reverb/arabic-eou-conversations
Viewer • Updated • 11.7k • 350
Fine-tuned SmolLM2-135M model for detecting end-of-utterance (EOU) in Arabic conversations.
This model predicts when an Arabic speaker has finished their turn in a conversation based on transcribed speech. It's designed for real-time voice assistants, LiveKit agents, and conversational AI systems.
Key Features:
| Metric | Score |
|---|---|
| F1 Score | 0.913 |
| Accuracy | 0.913 |
| Precision | 0.906 |
| Recall | 0.921 |
| AUC-ROC | 0.958 |
Inference Speed:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
model = AutoModelForSequenceClassification.from_pretrained(
"Reverb/smollm2-135m-arabic-eou"
)
tokenizer = AutoTokenizer.from_pretrained(
"Reverb/smollm2-135m-arabic-eou"
)
# Predict
text = "شو رأيك نروح نتغدا؟"
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=-1)
prediction = torch.argmax(probs, dim=-1).item()
confidence = probs[0][prediction].item()
print(f"EOU: {prediction == 1}, Confidence: {confidence:.3f}")
# Output: EOU: True, Confidence: 0.952
# Using previous utterance as context
context = "كيف حالك؟"
current = "الحمد لله بخير"
text_with_context = f"{context} [SEP] {current}"
inputs = tokenizer(text_with_context, return_tensors="pt", max_length=256, truncation=True)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=-1)
is_eou = torch.argmax(probs, dim=-1).item() == 1
confidence = probs[0][1 if is_eou else 0].item()
print(f"EOU: {is_eou}, Confidence: {confidence:.3f}")
texts = [
"شو رأيك", # Partial - NOT_EOU
"شو رأيك نروح نتغدا؟" # Complete - EOU
]
inputs = tokenizer(texts, return_tensors="pt", padding=True, truncation=True, max_length=256)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=-1)
predictions = torch.argmax(probs, dim=-1)
for text, pred, prob in zip(texts, predictions, probs):
is_eou = pred.item() == 1
conf = prob[pred].item()
print(f"'{text}' → {'EOU' if is_eou else 'NOT_EOU'} ({conf:.3f})")
Real-time Voice Agent
# Process STT transcription
is_eou, confidence = detect_eou(transcription)
if is_eou and confidence > 0.7:
# User finished speaking, generate response
agent_response = generate_response(transcription)
LiveKit Integration
from livekit_eou_sdk import ArabicEOUTurnDetector
detector = ArabicEOUTurnDetector(threshold=0.7)
is_eou, conf = await detector.process_transcription(text, is_final=True)
@misc{arabic-eou-detector-2025,
author = {Reverb},
title = {Arabic End-of-Utterance Detector},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Reverb/smollm2-135m-arabic-eou}},
note = {Fine-tuned SmolLM2-135M for Arabic EOU detection}
}
MIT License
For questions or issues, please open an issue on the model repository.
Model Card Version: 1.0
Last Updated: December 2025
Base model
HuggingFaceTB/SmolLM2-135M