The project for the NLP course: an Eliza-like chatbot created combining classic generic regex matching and specific spacy matching.
- pip install python-telegram-bot
- pip install clean-text
- pip install setuptools wheel
- pip install spacy
- python -m spacy download en_core_web_lg
- pip install numpy
- pip install nltk
- pip install transformers
- main.py contains the connection to the telegram API.
Runs this file to start up the telegram bot. - logic.py contains the main logic of the chatbot.
Runs this file to use the terminal version of the chatbot.
The hard_coded_case flag let the bot respond to an hard-coded input. Disable it if you want to chat with the bot via terminal. - sentence_analysis.py contains all the functions used to analyze the user input text with Spacy.
- emotion_analyzer_classifier.py allows to load a pre-trained emotion classifier using the Transforms API.
- NLTK_Chat_modified.py is a modified version of NLTK Chat that allows me to create more sophisticated pairs/rules pattern->responses.
- responses.py contains
- the specific patterns/responses rules ;
- the generic patterns/responses rules (these responses are emotion-sensitive) ;
- the memory patterns/responses rules (it allows to create a sentence given a memory frag);
- the reflections used to reflect pronouns and eventually the verb associated to them.
- my_secrets.py should contain the bot's token given by the @BotFather.