A discord bot that can adapt to the user's speech patterns to answer the hard questions and provide personalized relationship help - using generative AI and NLP
Built with Python and Cohere API
Disclaimer: Cupid bot is purely for entertainment purposes and is not indicative of my opinions on human relationships😅
The dreaded trap relationship questions where it seems like there is no right answer. Would you still love me if I was a worm?, If you had to kiss my best friend to save my life, would you do it?, Aren't they pretty? They are so pretty right?? A real hair-puller right.
Cupid bot aims to solve this problem by using previous conversation data and AI to construct the perfect, most optimal answer. Based on your personal speech patterns AND your significant other's ideal communication style
Note that for this demo, Cupid bot was trained to mimic a very affectionate boyfriend whose replying to a girlfriend that responds well to sweet messages and compliments.
Invoking the \cupid_gen command in discord will prompt the bot to read in the previous message sent in the chat, and reply to it
Cupid Bot has basic emotional intelligence
Cupid bot knows to use the User's commonly used emojis and words. It's almost creepy...
Notice the short forms and texting style
Cupid bot is funny
Note that these bot messages are normally only visible to the user (as a discord Ephemeral message) but were exposed for demo sake
To effectively show Cupid bot's ability to match speech patterns and adapt to the target who it's responding to, I trained Cupid Bot on my friend and my chat logs
Very different style
Context: we normally ask each other to play League
Prompt generated courtesy of ChatGPT
In case you're in the middle of a game/video/project and need to quickly reply to your significant other
Above is the general flow which I followed, starting from the top left.
Text messages were extracted into the following format:
- Prompt (target) - "How do you like my new hairstyle?"
- Message (user) - "Wow it looks great on you!"
- Response (target) - "Aw, thanks!!!"
Then each Response was tagged with a Response Semantic using the Cohere Classify Endpoint. (Positive/Negative/Neutral)
From here, all rows in the table tagged with a non-Positive response were removed, along with the Response column - leaving us with only the Prompt-Message pairs which we know the target responds well to
These Prompt-Message pairs were then used to train the Generative AI Model. Allowing for the bot to pick up on the optimal responses to the target's "Prompts".
Disclaimer: Cupid Bot is not liable if it were to damage your relationships.
Setup is quite complex right now, a future goal would be to simplify it.
clone the repo
Install dependencies
pip install cohere
pip install pandas
Use DiscordChatExporter to extract messages from you and your significant other (or friend)
Export as a .txt file
The period of time you choose to extract is up to you
Place the .txt into the project's root directory
Run the main.py
file, either with your editor's code runner or python main.py
This will output the training-generate.csv file
Create a customized Generate model with Cohere and input the training-generate.csv file
Fill in the MODEL_ID field in CohereLayer.py
with the customized model ID produced
Fill in the examples.py
file with desired prompt (Keep in mind, mine examples.py is hidden for privacy sake, but I will provide a template for this)
Run the bot!