https://github.com/kgelli/nlp-qa-chatbot
A neural network chatbot that answers questions about stories using memory networks trained on the Facebook Babi dataset.
https://github.com/kgelli/nlp-qa-chatbot
chatbot deep-learning keras memory-networks neural-networks nlp
Last synced: 25 days ago
JSON representation
A neural network chatbot that answers questions about stories using memory networks trained on the Facebook Babi dataset.
- Host: GitHub
- URL: https://github.com/kgelli/nlp-qa-chatbot
- Owner: kgelli
- Created: 2024-10-27T09:47:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-05T09:30:39.000Z (over 1 year ago)
- Last Synced: 2025-03-24T03:18:04.893Z (about 1 year ago)
- Topics: chatbot, deep-learning, keras, memory-networks, neural-networks, nlp
- Language: Jupyter Notebook
- Homepage:
- Size: 1.69 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Question-Answer Chat Bot
A simple question-answering chatbot built using neural networks to understand and respond to queries about object locations and movements.
## Project Overview
This project implements a memory network model that can answer simple questions about stories. The chatbot is trained on the Facebook Babi dataset, which consists of short stories followed by questions.
## Features
- End-to-end memory network architecture
- Processes natural language questions about object locations
- Provides yes/no answers with probability of certainty
- Supports custom stories and questions using vocabulary from the training data
## Model Architecture
The model uses:
- Embedding layers to convert words to vectors
- Memory encoding for both stories and questions
- Attention mechanism to focus on relevant parts of the story
- LSTM layer to process the combined information
- Softmax output layer for final prediction
## Dataset
The model is trained on the Facebook Babi dataset which includes:
- 10,000 training examples
- 1,000 test examples
- Simple stories about people and objects moving between locations
## Requirements
- Python 3
- TensorFlow/Keras
- NumPy
- Matplotlib
- Pickle
## Usage
1. Train the model or use the pre-trained weights (chatbot_120_epochs.h5)
2. Input stories and questions using vocabulary from the dataset
3. Get predictions with confidence scores
## Example
```python
my_story = "John left the kitchen. Sandra dropped the football in the garden."
my_question = "Is the football in the garden?"
# Result
# Predicted answer is: yes
# Probability of certainty was: 0.97079676
```
## Performance
The model achieves over 90% accuracy on the test dataset after 120 epochs of training.
## Limitations
- Limited to the vocabulary in the training dataset
- Only handles yes/no questions
- Designed for simple, direct questions about object locations