Table of Contents
The objective of this project is to create a chatbot that can be used to create awareness about the crimes, by fetching statistical data from the dataset. The chatbot will ask query about your problem and fetch the data based on the intents and entities recognized from the trained data. It can also help in registering compliants through chatbot. An interactive Map has been developed in the application to fetch nearby police stations and register an SOS.
- NLTK Python library is used to tokenize words into input arrays, which are then provided as inputs to a neural network.
- Patterns will be input arrays and tag will be as the label to train the model.
Screenshots of the application
To get a local copy of this application up and running follow these example steps.
- Python & NodeJS had to be installed in the local system.
-
Clone the repository
git clone https://github.com/bqwerr/Crime-Awareness-Bot.git
-
In the root project directory, open a terminal and create a virtual environment to install python libraries.
cd Backend pip install virtualenv virtualenv env env\Scripts\activate
-
Now install python libraries
pip install -r requirements.txt
-
Run the application, using below commands in sequence
python manage.py makemigrations python manage.py migrate python manage.py runserver
- Now the application will be running at http://localhost:8000.
- In the root project directory, input below commands.
cd Frontend
npm install
npm start
- Now the application will be running at http://localhost:3000.
-
To get the required entities from the query provided by user, Create a Dialogflow agent and train accordingly. Then post the query to the agent using Python, to get recognized entities from the trained agent.
- Place your project service account key in the root folder, to use dialogflow api using python.
- Service account key can be found from google cloud console.
-
To use MapBox API at the frontend, replace the API key with yours.
- MapBox API key can be created at https://www.mapbox.com/