Downloads · 30 days
0
Yahia-123/Qwen2.5-1.5B-Instruct_EOU
Qwen2.5-1.5B-Instruct_EOU is a machine learning model from Yahia-123. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository documents the fine-tuning and integration of Qwen/Qwen2.5-1.5B-Instruct for the task of End-of-Utterance (EOU) detection in conversational text. The model is adapted to determine whether a given user u…
Downloads · 30 days
0
Access
Public
Updated Dec 14, 2025
Repo size
20.2 MB
Likes
0
Public
Click a slice to open those files.
.json14.2 MB · 58%
From the Hugging Face model README
This repository documents the fine-tuning and integration of Qwen/Qwen2.5-1.5B-Instruct for the task of End-of-Utterance (EOU) detection in conversational text. The model is adapted to determine whether a given user utterance represents the end of a conversational turn (1) or whether the speaker is likely to continue (0).
The work is part of a larger AI Voice Agent system, where accurate turn-boundary detection is critical for natural, low-latency human–machine interaction—especially in streaming speech-to-text (STT) scenarios and Saudi/Arabic dialogue.
This README focuses on:
EOU detection is framed as a binary decision task:
0 → The utterance is incomplete; the speaker is likely to continue1 → The utterance represents the end of a conversational turnAlthough conceptually a classification problem, the task is implemented using a causal language modeling (instruction-following) paradigm, where the model is prompted to generate a single token (0 or 1) as its response.
This design choice aligns with:
The Qwen2.5-1.5B-Instruct model was selected due to:
0 or 1)The model is fine-tuned to respond to a structured instruction prompt, such as:
"You are an end-of-utterance detection assistant. Reply with only 0 or 1."
Given a user utterance, the model learns to generate the correct binary output based on conversational completeness.
The fine-tuning dataset consists of conversational utterances annotated for EOU detection. The dataset includes:
(Full dataset preparation and annotation methodology is documented separately.)
Standard binary classification metrics were used:
In addition, confusion matrix analysis was used to understand:
This evaluation strategy reflects real-world deployment concerns in voice agents and streaming dialogue systems.
Rather than optimizing for raw accuracy alone, emphasis was placed on:
This model is part of a larger AI Voice Agent system. The overall project structure is shown below:
AI-Voice-Agent/
│
├── data/
│ └── Dataset Preparation
│ └── (filtering, cleaning, annotation, EOU generation)
│
├── EOU_turn_detection/
│ ├── detector.py
│ │ └── Loads the fine-tuned Qwen2.5 EOU model
│ │ └── Exposes a simple EOU prediction interface
│
├── Qwen2.5-1.5B_arabic_EOU/
│ └── Fine-tuned model weights and tokenizer
│
├── Qwen_Qwen2.5-1.5B-Instruct_EOU.ipynb
│ └── Google Colab notebook used for fine-tuning and evaluation
│
├── voice_agent/
│ └── LiveKit-based voice agent
│ └── Real-time audio streaming
│ └── STT integration
│ └── Uses EOU predictions to manage turn-taking
│
├── .env
│ └── Environment variables and API keys
│
├── requirements.txt
│ └── Python dependencies
│
└── README.md
This structure ensures modularity, reproducibility, and clean separation between model training, inference, and real-time voice interaction logic.
Within the voice agent, the EOU model plays a central role in turn management:
User speech is streamed via LiveKit
Speech-to-Text (STT) produces partial and overlapping transcripts
Each transcript chunk is passed to the EOU detector (detector.py)
The model predicts whether the current utterance is complete
When EOU = 1:
When EOU = 0:
This approach enables:
Below is the minimal inference example exactly as used in this project. It demonstrates how to load the fine-tuned Qwen2.5-EOU-Detection model and generate a binary End-of-Utterance prediction.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Yahia-123/Qwen2.5-1.5B-Instruct_EOU"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
def predict_eou(text):
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(
**inputs,
max_new_tokens=1,
do_sample=False
)
return tokenizer.decode(
output[0][inputs.input_ids.shape[-1]:],
skip_special_tokens=True
).strip()
# Example
text = "Hello, how are you?"
print(predict_eou(text)) # "0" or "1"
These limitations are acceptable within the current voice-agent design and can be addressed in future iterations.
This project demonstrates how a modern instruction-tuned LLM can be adapted—using parameter-efficient fine-tuning—for real-time conversational turn detection. By integrating the fine-tuned Qwen2.5-1.5B-Instruct model into a live voice agent, the system achieves more natural, human-like dialogue flow, particularly in Arabic and Saudi dialect scenarios.