An open API service indexing awesome lists of open source software.

https://github.com/barraharrison/ai-chatbot

Building an AI Chatbot in Python using PyTorch.
https://github.com/barraharrison/ai-chatbot

chatbot-application machine-learning python pytorch

Last synced: 6 months ago
JSON representation

Building an AI Chatbot in Python using PyTorch.

Awesome Lists containing this project

README

          

# πŸ€– AI Chatbot Assistant

Welcome to the **AI Chatbot Assistant**, a powerful and interactive Python-based chatbot built using **PyTorch**, **PyQt5**, and modern AI libraries. This project combines machine learning, voice recognition, text-to-speech, and real-time APIs β€” all within a sleek GUI interface.

Whether you prefer typing or speaking, this assistant is ready to help with news updates, weather forecasts, stock prices, jokes, and more!

---

## πŸš€ Features

βœ… **Terminal Chatbot** – Classic command-line interface powered by a custom-trained PyTorch model.

βœ… **Voice Recognition** – Speak naturally to the bot using your microphone via Google Speech Recognition.

βœ… **Text-to-Speech (TTS)** – The chatbot talks back using `pyttsx3`, supporting multiple voices and languages.

βœ… **Real-Time API Integrations**
- **News Headlines** (NewsAPI.org)
- **Weather Forecasts** (OpenWeatherMap)
- **Stock Market Prices** (TwelveData API)

βœ… **Graphical User Interface (GUI)** – Built with `PyQt5`, the bot features a clean, interactive design inspired by modern assistant apps.

βœ… **Standalone Terminal App** – Runs independently from your terminal using the pre-trained model, no retraining required.

βœ… **Custom App Icon** – Personalized `.icns` icon for use when packaged into a native desktop application (macOS).

---

## πŸ’ͺ Installation & Setup

### 1. Clone the Repository
```bash
git clone https://github.com/YourUsername/AI-Chatbot-Assistant.git
cd AI-Chatbot-Assistant
```

### 2. Create and Activate a Virtual Environment
```bash
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```

### 3. Install Dependencies
```bash
pip install -r requirements.txt
```

> If `requirements.txt` is missing, manually install:
```bash
pip install torch numpy nltk pyttsx3 PyQt5 speechrecognition python-dotenv requests
```

### 4. Add Your `.env` File
Create a `.env` file in the root directory and include the following:
```env
NEWS_API_KEY=your_newsapi_key
WEATHER_API_KEY=your_openweathermap_key
STOCK_API_KEY=your_twelvedata_key
```

---

## 🧠 Running the Chatbot

### βž” Option 1: Terminal Mode
```bash
python3 main.py
```

### βž” Option 2: GUI Mode (with voice + TTS)
```bash
python3 chat_gui.py
```

Once launched, the chatbot will be ready to interact with you using text or voice.

---

## 🎀 Voice Commands Examples

- β€œTell me a joke”
- β€œWhat's the weather like?”
- β€œHow is Nvidia doing today?”
- β€œWhat are the latest news headlines?”
- β€œWhat’s today’s date?”

---

## πŸ“¦ Packaging (Optional)
You can package the app into a macOS `.app` bundle using PyInstaller:
```bash
pyinstaller chat_gui.spec
```
> Remember to configure `datas` and `icon` correctly in the `.spec` file.

---

## πŸ“š Conclusion

This AI Chatbot Assistant is more than just a project β€” it's a complete personal assistant powered by speech, APIs, and machine learning. Whether you’re a developer learning NLP or just want a smart terminal buddy, this assistant is built to adapt and grow.

---

## πŸ§‘β€πŸ’» Author

Built with πŸ’» by **Barra Harrison**
[GitHub](https://github.com/BarraHarrison)

---

## πŸ“œ License

This project is licensed under the MIT License.

---