Interactive ChatBot in Turkish

Training a seq2seq chatbot on Turkish Twitter data and giving it a voice.

ChatBot interaction demo

This was one of my earlier projects — a chatbot that could hold a conversation in Turkish, complete with a wake word to activate it and a physical-looking interface to interact with. The idea was simple: train a sequence-to-sequence model on Turkish Twitter conversations and make it feel like talking to someone.

The query "sen güzel bir kızsın" (you're a beautiful girl) would get a response like "sen daha güzelsin!!" (you're even more beautiful!!). Not perfect, but fun.

How It Works

The system has two main parts:

1. Trigger Word Detection

Before you can talk to the bot, you need to wake it up — just like saying "Alexa" to an Amazon Echo. Our trigger phrase was "uyan ay" (wake up, moon). When the bot hears it, it activates and starts listening.

Trigger word detection demo

2. ChatBot (Seq2Seq Model)

The chatbot is a task-specific system focused on general conversation. For any input text — a question, a joke, a statement — it generates a response derived from patterns it learned from Turkish Twitter data.

The flow is:

  • Voice → Text: Your speech is converted to text using Google's voice recognition API
  • Text → Text: The seq2seq model generates a response
  • Text → Voice: The response is spoken back through the human interface

query: seni çok seviyorum. (I love you so much.)

ChatBot: ben de seni çok seviyorum yanımızda olduğun için sonsuz teşekkürler. (I love you too, thank you so much for being with us.)

ChatBot responding to query

Tech Stack

  • Python 3
  • TensorFlow ≤ 1.11.0 — for the seq2seq model
  • TensorLayer ≥ 1.6.3 — high-level deep learning library
  • Google Voice Recognition API — for speech-to-text
  • Internet connection required for voice APIs

Installation

Ubuntu:

sudo apt install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0 ffmpeg libav-tools
sudo apt-get install python3-tk
pip3 install -r requirements.txt

Windows:

pip install -r requirements.txt

Running It

# Ubuntu (Python 3)
python3 my_robot.py

# Ubuntu (Python 2)
python my_robot.py

# Windows
python my_robot.py

Looking Back

This project taught me a lot about NLP, sequence models, and the challenges of working with Turkish — a language with complex morphology that doesn't play nicely with standard tokenization. The seq2seq approach was state-of-the-art at the time, before transformers took over.

If I were to rebuild this today, I'd use a fine-tuned transformer model and skip the voice recognition API entirely — running Whisper locally would make the whole thing work offline. But that's the beauty of old projects: they show you how far the field has come.

← back to all posts
Ataa

Ataa Aldaghstani

Full-stack & AI engineer. Building things that work. Based in Türkiye.