Downloads · 30 days
15
18% of all-time downloads
Fahim000/SmolLM2-finetuned
SmolLM2-finetuned is a text classification model from Fahim000. Use it when you need a label for a piece of text. It is set up for transformers.
The objective of this project is to fine-tune a model for Arabic end-of-utterance (EOU) detection. The model outputs the probability that a speaker will finish their turn based on the received transcription. This capa…
Downloads · 30 days
15
18% of all-time downloads
All-time downloads
83
Public
Parameters
135M
538 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors538 MB · 99%
From the Hugging Face model README
The objective of this project is to fine-tune a model for Arabic end-of-utterance (EOU) detection. The model outputs the probability that a speaker will finish their turn based on the received transcription. This capability is crucial for enhancing the accuracy and responsiveness of real-time AI voice agents in Arabic-speaking contexts, thereby enabling more natural and effective conversational interactions.
Hams's_Task/
├── notebook/
├── data_ingestion.ipynb # Data collection and fucntions for labeling the data correctly
├── data_preprocessing.ipynb # Data Preprocessing and EDA on the collected data
├── fine_tuning/
├── distilbert-base-multilingual-cased.py # Fine-Tuned Distillbert model
├── fine_tuning_SmolLM2.py # Fine-Tuned SmolLM2 (Choosed as its performace were good)
├── SmolLM2_Artifacts # Contain the artifacts of SmolLM2 model
├── distillbert_artifacts # Contain the Confusion Metric image of Distillbert
├── README.md
├── raw_data/
├── dataset.csv # This is the dataset taken from Github
│ ├── labeled_data.csv # Initial processing operation performed on the GitHub dataset like removing unnecessarily columns etc and the dataset by the name of "labeled_data.csv".
│ ├── yt_saudi_turns.csv # Collected YouTube transcripts data (Saudi Conversational)
│ ├── final_raw_data.csv # Combined initial datasets (labeled_data.csv + yt_saudi_turns.csv)
│ ├── correct_labeled_data.csv # Fixed labeling errors on the "final_raw_data.csv"
│ ├── preprocessed_data.csv # Take the "correct_labeled_data.csv" and perform basic preprocessing and EDA
│ ├── manual_data_collection/
│ │ └── manual_data.csv # Manually collected data
│ └── clean_data/
│ └── processed_data.csv # Take the "manual_data.csv" and "preprocessed_data.csv" and make the final cleaned dataset
└── model_data/ # Take the "processed_data.csv" and split into trainig and validation
├── training_data.csv # Training split (80%)
└── validation_data.csv # Validation split (20%)
Source: GitHub dataset (dataset.csv)
raw_data/labeled_data.csvSource: Saudi conversational video transcripts
raw_data/yt_saudi_turns.csvraw_data/final_raw_data.csvraw_data/correct_labeled_data.csvraw_data/preprocessed_data.csvraw_data/manual_data_collection/manual_data.csvraw_data/clean_data/processed_data.csvmodel_data/training_data.csvmodel_data/validation_data.csv| Dataset | Location | Description |
|---|---|---|
| Initial | raw_data/labeled_data.csv | GitHub conversational data |
| YouTube | raw_data/yt_saudi_turns.csv | Saudi video transcripts |
| Combined | raw_data/final_raw_data.csv | Merged initial datasets |
| Corrected | raw_data/correct_labeled_data.csv | Fixed labeling errors |
| Preprocessed | raw_data/preprocessed_data.csv | Basic text cleaning |
| Manual | raw_data/manual_data_collection/manual_data.csv | Hand-collected data |
| Final | raw_data/clean_data/processed_data.csv | Complete cleaned dataset |
| Training | model_data/training_data.csv | Model training data |
| Validation | model_data/validation_data.csv | Model validation data |
This repository contains the results of fine-tuning two different models for End-of-Utterance (EOU) detection in Arabic text. The task involves binary classification to determine whether a given text represents the end of an utterance or not.
We compared two models:
End-of-Utterance Detection is a binary classification task where:
| Step | Training Loss | Validation Loss | Accuracy | Precision | Recall | F1 Score |
|---|---|---|---|---|---|---|
| 100 | 0.382900 | 0.301439 | 0.864865 | 0.864664 | 0.864865 | 0.863368 |
| 200 | 0.302400 | 0.269788 | 0.874266 | 0.882617 | 0.874266 | 0.875527 |
| 300 | 0.201800 | 0.231544 | 0.914219 | 0.915077 | 0.914219 | 0.913335 |
| 400 | 0.146300 | 0.202987 | 0.921269 | 0.922963 | 0.921269 | 0.921644 |
| 500 | 0.043100 | 0.224561 | 0.936545 | 0.936483 | 0.936545 | 0.936316 |
| 600 | 0.046800 | 0.230006 | 0.942421 | 0.942320 | 0.942421 | 0.942303 |
| 700 | 0.016800 | 0.218244 | 0.949471 | 0.949409 | 0.949471 | 0.949428 |
| 800 | 0.004300 | 0.245689 | 0.950646 | 0.951005 | 0.950646 | 0.950371 |
| 900 | 0.000400 | 0.236911 | 0.950646 | 0.950692 | 0.950646 | 0.950468 |
| 1000 | 0.001400 | 0.234034 | 0.950646 | 0.950631 | 0.950646 | 0.950500 |
| Metric | Score |
|---|---|
| Overall Accuracy | 0.9506 |
| Overall Precision | 0.9506 |
| Overall Recall | 0.9506 |
| Overall F1-Score | 0.9505 |
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| Class 0 (No EOU) | 0.9511 | 0.9693 | 0.9602 |
| Class 1 (EOU) | 0.9498 | 0.9210 | 0.9352 |

| Step | Training Loss | Validation Loss | Accuracy | Precision | Recall | F1 Score |
|---|---|---|---|---|---|---|
| 200 | 0.392800 | 0.312217 | 0.870740 | 0.870495 | 0.870740 | 0.869458 |
| 400 | 0.187000 | 0.229390 | 0.914219 | 0.922040 | 0.914219 | 0.912031 |
| 600 | 0.085800 | 0.260901 | 0.930670 | 0.932843 | 0.930670 | 0.931060 |
| 800 | 0.034100 | 0.246878 | 0.942421 | 0.942771 | 0.942421 | 0.942529 |
| 1000 | 0.010300 | 0.222678 | 0.949471 | 0.949445 | 0.949471 | 0.949457 |
| Metric | Score |
|---|---|
| Overall Accuracy | 0.9495 |
| Overall Precision | 0.9494 |
| Overall Recall | 0.9495 |
| Overall F1-Score | 0.9495 |
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| Class 0 (No EOU) | 0.9579 | 0.9598 | 0.9589 |
| Class 1 (EOU) | 0.9360 | 0.9331 | 0.9346 |

✅ Excellent Performance: The validation loss consistently decreases while accuracy and other metrics improve, indicating good generalization. This model shows no signs of overfitting and is recommended for production use.
| Arabic Text | DistilBERT Prediction | SmolLM2 Prediction |
|---|---|---|
| طيب، بس لازم نتفق أول. | No EOU (0.9864) | No EOU (0.9999) |
| هل تقدر توصلني بكرا؟ | EOU (0.9996) | EOU (1.0000) |
| أنا حاولت، لكن ما فهمت الدرس. | EOU (0.9992) | EOU (0.9900) |
| بس انت ما قلت لي متى نبدأ | No EOU (0.8094) | No EOU (0.9968) |
| شكراً كثير على المساعدة. | EOU (0.9994) | EOU (0.9999) |
| طيب نكمل بعدين؟ | EOU (0.9996) | EOU (1.0000) |
| يعني أنا كنت أنتظر منك ترد علي | EOU (0.7838) | No EOU (0.9912) |
| أنا آسف إذا زعلتك. | EOU (0.9674) | No EOU (0.9537) |
| لا تنسى ترجع المفتاح بعدين | No EOU (0.9992) | No EOU (0.9998) |
| هذا الشيء ما توقعت يصير! | EOU (0.9996) | EOU (1.0000) |
| هو قال لي أنو لازم ننتبه | EOU (0.9993) | EOU (0.7345) |
| إيش رأيك نطلب بيتزا؟ | EOU (0.9996) | EOU (1.0000) |
| أصلاً ما كان المفروض نجي | No EOU (0.9970) | EOU (0.9608) |
| طيب، نكمل الحين ولا بعدين؟ | EOU (0.9996) | EOU (1.0000) |
| أنا ما أقدر أقرر لحالي | EOU (0.9991) | No EOU (0.9815) |
| والله ما كنت أقصد. | No EOU (0.9991) | No EOU (1.0000) |
| Model | Accuracy | Precision | Recall | F1-Score | Overfitting |
|---|---|---|---|---|---|
| SmolLM2-135M | 0.9495 | 0.9494 | 0.9495 | 0.9495 | ⚠️ No |
| DistilBERT-Multilingual | 0.9506 | 0.9506 | 0.9506 | 0.9505 | ✅ Yes |
SmolLM2-135M is the recommended model for this task because:
To use the trained SmolLM2-135M model:
# Load the model
model = SmolLM2Model.from_pretrained('path/to/smollm2-eou-detector')
# Make predictions
text = "هل تقدر توصلني بكرا؟"
prediction = model.predict(text)
print(f"Prediction: {prediction}")