Skip to content

Commit

Permalink
Moved out rasa X requirement and made another simple website-based GU…
Browse files Browse the repository at this point in the history
…I using Rasa WebChat. Updated necessary files, and README.md
  • Loading branch information
aadiraju committed Mar 25, 2021
1 parent 7320024 commit 91e58fb
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 19 deletions.
18 changes: 18 additions & 0 deletions GUIWebsite/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
* {
font-family: "Open Sans", Helvetica, "Helvetica Neue", sans-serif;
box-sizing: border-box;
}

.chat-container {
margin: 100px auto;
width: 360px;
z-index: 100;
box-shadow: 0 0 3em black;
}

@media (max-width: 400px) {
.chat-container {
margin: 20px 10px;
width: auto;
}
}
22 changes: 22 additions & 0 deletions GUIWebsite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://npm-scalableminds.s3.eu-central-1.amazonaws.com/@scalableminds/chatroom@master/dist/Chatroom.css" />
<link rel="stylesheet" href="index.css" />
</head>
<body>
<div class="chat-container"></div>
<script src="https://npm-scalableminds.s3.eu-central-1.amazonaws.com/@scalableminds/chatroom@master/dist/Chatroom.js"/></script>
<script type="text/javascript">
var chatroom = new window.Chatroom({
host: "http://localhost:5002",
title: "Chat with JokeBot",
container: document.querySelector(".chat-container"),
welcomeMessage: "Hi, I am JokeBot. How may I help you?",
speechRecognition: "en-US",
voiceLang: "en-US"
});
chatroom.openChat();
</script>
</body>
</html>
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,35 @@
An interactive bot made with Rasa that tells the user jokes. The bot is a friend trying to become a comedian and the user's role is to give feedback on their jokes.

## How to Run
To run the bot, make sure you have `rasa x` installed on `Anaconda` or any python virtual environment. For detailed instructions on the installation of Rasa please refer to the official documentation: [How to Install Rasa X](https://rasa.com/docs/rasa-x/installation-and-setup/install/local-mode).
To run the bot, make sure you have `rasa` installed on `Anaconda` or any python virtual environment. For detailed instructions on the installation of Rasa please refer to the official documentation: [How to Install Rasa](https://rasa.com/docs/rasa/installation/).

If you want to install Rasa X by itself, usually all you need to do to install rasa-x is run the following command:
```pip3 install --use-deprecated=legacy-resolver rasa-x --extra-index-url https://pypi.rasa.com/simple```
We use this specific command since for now, `pip`'s dependency resolver makes this installation take way too long, and this is a temporary fix until `pip v21` is released.
Usually all you need to do to install rasa is run the following command:
```pip3 install rasa```
If the above doesn't work, refer to the documentation linked above.


Once Rasa X has been installed, navigate to the root folder of the project, and do the following:
- run `rasa x` and wait for it to launch. **Note:** This may take a while depending on your system.
Once Rasa has been installed, navigate to the root folder of the project, and do the following:
- run `rasa run --m ./models --endpoints endpoints.yml --port 5002 -vv --enable-api --cors "*"` and wait for it to launch. **Note:** This may take a while depending on your system.
- _**VERY IMPORTANT**_ : In a **separate** terminal window/tab, run the command `rasa run actions`, to run a custom actions server for the bot to be able to work properly.
- If there is an error about `spaCy` model not being able to loaded, run the following command, and it should work: `python -m spacy download en_core_web_md`

Once the commands finish running, they should open up a browser window that goes directly to Rasa X like so:
Once the commands finish running, in another **separate** terminal (That's 3 in total), navigate to the `GUIWebsite` folder using something like `cd GUIWebsite` from the root folder.
Then type the following into the console to start up the server: `python -m http.server 8000`

![Rasa X startup page](images/rasaxhome.png)
Once that is done, type `localhost:8000` into your browser's URL field, and you should be greeted
with this page:

If you hover over the toolbar to the left, and click the option that says "Talk to you assistant", you can speak to the bot in a GUI.

![Rasa X talk to your assistant option](images/rasaxtalk.png)

On this screen, simply type a message like "hey", to get started!

![Rasa X chat window](images/rasaxchat.png)
![JokeBot chat window](images/botchat.png)

Have fun talking to our bot!

## New Features for A3
- ### Graphical User interface

- ### Extra Topic
For A3, We decided to include an extra topic for our joke bot in the form of memes. Since "memes" are another form of jokes that are part of a rapidly
advancing movement that brings humour to the internet, we included them as an extra topic for our bot. When the user asks for memes, the bot will deliver by
showing them a link to a few galleries filled with some memes, which are
- ### Out of Scope Message Handling
- ### Synonym Recognition
- ### Named Entity Recognition
Expand Down
8 changes: 4 additions & 4 deletions credentials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ rest:
# slack_channel: "<the slack channel>"
# slack_signing_secret: "<your slack signing secret>"

#socketio:
# user_message_evt: <event name for user message>
# bot_message_evt: <event name for bot messages>
# session_persistence: <true/false>
socketio:
user_message_evt: user_uttered
bot_message_evt: bot_uttered
session_persistence: false

#mattermost:
# url: "https://<mattermost instance>/api/v4"
Expand Down
Empty file removed events.db-wal
Empty file.
Binary file added images/botchat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 91e58fb

Please sign in to comment.