ApostleAI is a conversation bot modeled after Paul the Apostle, commonly known as Saint Paul, an apostle who spread the teachings of Jesus in the first-century world.
To run the this project on your local machine;
- Install
NodeJS
. - Change the current working directory to the location where you want the cloned directory.
- In your terminal type,
$ git clone https://github.com/prophet-ai/ApostleAI
. - After the repo has been cloned, hit the terminal with a
npm install
which should install all dependencies.
Once the dependencies have been installed, to start the local server;
- In your terminal, switch to your project directory and type
npm run start
which will run the server and host the application. - Nagivate to
hostname:8080
in your browser to see the project live. In local environments hostname will belocalhost
.
Note: Any updates saved to the files in your project folder will automatically be dispalyed on this server.
Improved already implemented GUI
Our team improved on our already implemented GUI from Assignment 2 by adding some stylistic features as well as revolving conversation suggestions along the top of the page.
Added an additional topic to our bot’s conversational repertoire
Our team added more topics to our bot’s conversational repertoire. Namely, the bot can now discuss topics like the meaning of life, purpose in life, and more!
Topic | Chat Example |
---|---|
Meaning of life | user: What is the meaning of life? bot: Maybe the meaning of life is in front of you right now, would you notice it? |
Purpose in life | user: What is my purpose? bot: Finding your purpose for living is your purpose for living. |
General Philosophy | user: Tell me something philosophical bot: To exist is to live |
Added detection for user messages outside of topics
Our bot can detect when a user is trying to talk about a topic that it doesn’t know or understand, and is able to respond with an adequate response.
Implementation of Porter-Stemming for spelling correction
Our team implemented the Porter-Stemming algorithm to correct any spelling errors in the user’s message before it is sent off to Wit.AI. This spell correction can be seen in action in the server side logs.
See the porter stemmer correction in action
Implementation of Wit.AI
Our team implemented Wit.AI, a natural language interface from Facebook, Inc. We use Wit.AI to process our user’s message’s and extract the ‘intent’ of the message. Our code makes API calls to Wit.AI including the user’s message, and in return we get a string of JSON data which includes what the bot could derive in terms of intention from the original user message. This is the cornerstone for our bot’s intelligence as we use these intents to decide how the bot will respond. The bot is trained on various different intents to accommodate our different topics and can be easily trained to understand more.
Implementation of Synonym Recognition through Wit.AI
Utilizing our implementation of Wit.AI, we were able to utilize some of Wit’s built-in functions to process synonyms. Our bot is naturally good at understanding synonyms and is able to extract the intention from the message with great confidence, and we augmented pre existing features to be even more precise.
Implementation of Named Entity Recognition through Wit.AI
Another feature of Wit.AI is named entity recognition that is built into its understanding processes, which we can use to detect specific entities like the user or the bot in conversation. Any detected entities by Wit.AI are sent via API call as well.
user: What is your name? // bot can detect user is asking about the bot itself
bot: I am ApostleAI, but you can call me Paul for short. //provides appropriate response
Implementation of Sentiment Analysis through Wit.AI
Thanks to our prior work with Wit.AI we were able to implement Sentiment Analysis to derive the mood of the user’s message. Utilizing Wit.AI’s Trait system, we are able to detect either a positive, neutral, or negative sentiment for the user’s message. By gauging the sentiment of the message, our bot is able to respond with an adequate and appropriate response in either a positive, neutral, or negative sentiment/tone.
Chat | Sentiment | Bot Response |
---|---|---|
'I failed my exam' | negative |
'Sometimes life is hard, you can do it!' |
'It is good to see you!' | positive |
'Hi There!' |
Implementation of Socket.IO for messaging between user and bot
Our team implemented Socket.IO originally as a means to allow our bot to converse with other bots, however after many attempts to connect with other bot’s, we were unsuccessful since the Apostle was too intelligent for other bots to understand. Thankfully, we were able to refactor the code and utilize it to send messages back and forth between the user and the bot. This enables us to have as many simultaneous independent conversations with the bot across multiple chat windows.
Connections being logged with message events highlighted
Automatic unit testing using GitHub and CI tool
Our team has implemented Unit Testing thanks to the Jest JavaScript testing framework from Facebook, Inc.
Additionally, we have implemented automated testing thanks to CircleCI, which automatically runs our unit tests anytime a commit is pushed to selected branches, and will not allow failed commits to be pushed to the
production branch (main branch). You can view our custom pipeline here.
Fully customized server side logging system
Our team has implemented a fully customized server side logging system which provides information on sockets connected to the socket server, messages being sent to and from the bot, returned information from Wit.AI, and more!
Save chat log of conversation with the bot
Our team implemented a very rudimentary chat logging and saving system. At any point in your conversation with the bot, you can save a text file which contains all messages up to that point.