Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blackiq/qandai
QandAI is a chatbot that uses artificial intelligence (AI) to answer user questions. It is built using Python, Flask, and scikit-learn, and can be easily customized to suit your needs.
https://github.com/blackiq/qandai
api chatbot flask machine-learning ml python question-answering
Last synced: 17 days ago
JSON representation
QandAI is a chatbot that uses artificial intelligence (AI) to answer user questions. It is built using Python, Flask, and scikit-learn, and can be easily customized to suit your needs.
- Host: GitHub
- URL: https://github.com/blackiq/qandai
- Owner: BlackIQ
- License: mit
- Created: 2023-03-18T16:56:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-04T19:11:26.000Z (over 1 year ago)
- Last Synced: 2024-11-13T00:31:50.657Z (3 months ago)
- Topics: api, chatbot, flask, machine-learning, ml, python, question-answering
- Language: Python
- Homepage: https://chat.amirhossein.info/api
- Size: 433 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QandAI - Your Question and Answer AI Chatbot
## Introduction
QandAI is a chatbot that uses artificial intelligence (AI) to answer user questions. It is built using Python, Flask, and scikit-learn, and can be easily customized to suit your needs.
## Features
QandAI has the following features:
- Simple and intuitive interface for asking questions
- Uses a Multinomial Naive Bayes model to predict the most likely answer to a given question
- Can be easily trained on new data to improve its accuracy
- Returns the top 3 most likely answers, ranked by probability
- API endpoint for programmatic access to the chatbot
- Includes sample data for testing and training## Getting Started
### Requirements
To use QandAI, you will need:
- Python 3.x
- Flask
- scikit-learn
- pandas
- joblib
- pipenv### Installation
To install QandAI, follow these steps:
1. Clone the repository from GitHub: `git clone https://github.com/BlackIQ/QandAI.git`.
2. Navigate to the project directory: `cd QandAI`.
3. Install the required dependencies: `pipenv install`.### Usage
To use QandAI, follow these steps:
1. Copy `.env.example` to `.env` and change `API_PORT` to your custome port.
2. Train the model on your own data or use the included sample data: `python3 app/core/core.py`
3. Start the Flask server: `python3 wsgi.py`
4. Send a POST request to the `/api/predict` endpoint with a JSON payload containing a `question` key and the user's question as the value.
5. The server will return a JSON response containing the top 3 most likely answers, ranked by probability.### Customization
To customize QandAI, you can modify the following:
- `data/faq_data.json`: Add or remove questions and answers to train the model on your own data
- `app/core/core.py`: Modify the code for preprocessing and vectorizing the input data
- `models/faq_model.joblib`: Train and save a new model with different hyperparameters or a different algorithm## License
This project is licensed under the MIT License - see the LICENSE file for details.
## Acknowledgments
QandAI was inspired by the many open-source chatbot projects available online. Thank you to the developers and contributors of scikit-learn, Flask, and joblib for their excellent libraries.