https://github.com/amine759/chattrafficviolation
https://github.com/amine759/chattrafficviolation
celery-task django huggingface-transformers langchain pineconedb redis-queue
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/amine759/chattrafficviolation
- Owner: amine759
- Created: 2024-02-02T19:13:01.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-09T00:48:52.000Z (over 1 year ago)
- Last Synced: 2025-05-04T09:12:42.440Z (11 months ago)
- Topics: celery-task, django, huggingface-transformers, langchain, pineconedb, redis-queue
- Language: Jupyter Notebook
- Homepage:
- Size: 5.35 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ChatTrafficViolation
This app was made in a data science Competition context, the app does the following :

It teaches the user about the moroccan traffic violation law (French only), in the [notebooks/analysis.ipynb](notebooks/analysis.ipynb) We have explored that we can categorize the moroccan amendements to 18 classes, after some feature engineering.
We are doing clustering instead of classification as it is easier, faster and also efficient with the use of vector databases.
The overral backend is as follows :

- We are using redis and celery to optimize the response time of the chatbot, since we are performing various operations that could be done asynchronously.
To run the app in your local machine :
1. clone repo
```bash
git clone https://github.com/amine759/ChatTrafficViolation.git
```
- navigate inside the project directory
```bash
cd ChatTrafficViolation
```
2. install and create virtual environnement in your local machine
```bash
python3 -m venv venv # install virtual environnement
. venv/bin/activate # this is a linux command only
```
3. install all necessary dependencies
```bash
pip install -r requirements.txt
```
4. You will need to have redis installed, I'm using its docker image. Pull the image and run it.
```bash
docker pull redis
docker run -d --name broker redis
```
5. apply django migrations
```bash
python3 manage.py migrate #
```
6. finally run django server
```bash
python3 manage.py runserver #
```
**Alternatively you can run the application from its DockerFile**:
```bash
docker build -t my-app .
docker run -d my-app .
```
7. You will also need to run Celery workers, run as much as you want.
```bash
celery -A pro worker --loglevel=DEBUG --concurrency=4 -P eventlet -n worker1
celery -A pro worker --loglevel=DEBUG --concurrency=4 -P eventlet -n worker2
```