A disaster relief call center project using KNN algorithm and some NLP tools
A disaster relief call center project using KNN algorithm and some NLP tools
>python -m venv env
To activate the environment
>env\Scripts\Activate
To deactivate the environment
>Deactivate
>pip install pandas
>pip install numpy
>pip install scikit-learn
>pip install PyAudio
>pip install SpeechRecognition
>pip install textblob
>python -m textblob.download_corpora
>pip install selenium
You can download chrome driver from here
Check which version of chrome you are running (help -> about Google Chrome) and download corresponding driver and copy it to your repository.
At the time of developing, Chrome version 78 was utilised.
There are two methods to convert audio from microphone to text:
I have commented Method 1 in severity1.py as it wasn’t giving accurate enough result for my particular accent. You can use that also if you wish so.
If proceeding with Method 2, then step to follow:
The caller should specify from which city he/she is calling
The caller should specify his/her problem clearly
The caller should tell what he/she needs
Using Selenium, a chrome instance (version 78) is created by python and taken to speechnotes. You have to manually select to allow Chrome to record audio in the prompt. After that my program takes care to itself click on “Start Recording” button and you just have to speak what you wanted to convert to text.
As converting recorded voice to text is done and appended to the website using Javasript, we can’t directly scrape the contents using BeautifulSoup. Thus we need to mimic the environment in which javascript can be run using Selenium.
Currently, speechtotext.py listens for 10 seconds. You may want to increase this duration if you are on slow internet.
Alternatively, in the Method 1 (using SpeechRecognition library), it is programmed to listen as long as someone is speaking.
This is the severity of each call received at the call center.
This is the severity per city of combined calls received at the call center.