https://www.nltk.org/install.html
pip install nltk
start python and run the following code:
import nltk
nltk.download('stopwords')
nltk.download('wordnet')
pip install azure-cognitiveservices-speech
https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/quickstart-python
https://azure.microsoft.com/en-in/services/cognitive-services/speech-services/
To modify mongodb database parameters, go to check_database_new() or check_database()
https://api.mongodb.com/python/current/installation.html
https://www.w3schools.com/python/python_mongodb_getstarted.asp
https://www.geeksforgeeks.org/convert-text-speech-python/
https://pypi.org/project/gTTS/
modify parameters inside function sentiment_analysis_monkeylearn(text)
pip install monkeylearn
https://monkeylearn.com/text-analysis/
Pyttsx3: pip install pyttsx3
Audio player: https://pypi.org/project/mpyg321/ (Not suitable for windows)
NOTE: For windows, replace os.system("mpg321 welcome.mp3") by os.system("start welcome.mp3")
Autocorrect:
pip install autocorrect
https://pypi.org/project/autocorrect/
python3 sum_project_new.py
(Before running, make sure database is ready with parameters updated in the code)
queries.txt (current implementation is using 'queries_bsnl.txt', can be modified in the main function)
Contains the workflow queries (check the attached 'queries_bsnl.txt' file for reference)
workflow_1.txt, workflow_2.txt .. (and so on, depending on number of workflows)
number of queries in 'queries.txt' file should be same as number of workflow files
every query has its on unique workflow file named workflow_x.txt (where x is the query number)
- Every sentence is preceded by a number and a character.
- It may be followed by 'p' or 'pu'
- Every line begins with a number which specifies the current flow and is always unique.
- Instructions on how that unique number is coded are given in the num_coding_instructions.docx file
- If a line ends with p, the sentence has to be communicated to the user.
- If a line ends with pu, the sentence has to be communicated to the user and database needs to be updated (like in the case of filing a complaint, database needs to be updated and complaint number should be communicated to the user)
- The second word of every line is a character which defines the purpose of the sentence (Whether that is a question (input required), a statement, or if there is something needed to be checked within the database). Further instructions can be found in num_coding_instructions.docx file.
python mongodb_test.py
. Make sure date is in the format dd-mm-yy (hyphens included)
- Azure Cognitive Services key: speech_key variable inside the main function
- Monkeylearn API key: ml variable inside sentiment_analysis_monkeylearn() function
- MongoDB parameters: myclient, mydb, mycol variables inside check_database_new() function
- Complaint file: fopen variable inside save_record function
Installation:
pip install websockets
https://websockets.readthedocs.io/en/stable/intro.html
SimpleWebSocketServer: pip install SimpleWebSocketServer
var socket
inside Webpage_client/script.js file. Specify the host server websocket URL. Ignore if server is localhost.server = SimpleWebSocketServer('', 8000, SimpleChat)
: replace ' ' by server URL. Ignore if server is localhost
- start python websocket server (server system)
python echo_server.py
. It should ideally be running continuously in the background - run the webpage client (Webpage_client/index.html).
- run the python script:
python test_new.py
. A welcome message should appear in chatbot if everything goes right.