Movie recommendation using RASA, TigerGraph

Overview

Demo run:

The below video will highlight the runtime of this setup and some sample real-time conversations using the power of RASA + TigerGraph,

IMAGE ALT TEXT HERE

Steps to run this solution:

Step-0:

Step-1: (Scroll down for detailed setup instructions)

  • cd Movie_Chatbot

Terminal-1:

  • $ rasa train
  • $ rasa run -m models --enable-api --cors "*" --debug

Terminal-2:

  • $ rasa run actions

Step-2: (Scroll down for detailed setup instructions)

  • Run tgcloud solution

Project Overview: Movie recommendations using RASA + TigerGraph

Conversational recommendation systems (CRS) using knowledge graphs is a hot topic as they intend to return the best real-time recommendations to users through a multi-turn interactive conversation. CRS allows users to provide their feedback during the conversation, unlike the traditional recommendation systems. CRS can combine the knowledge of the predefined user profile with the current user requirements to output custom yet most relevant recommendations or suggestions. This work will implement a chatbot using the open-source chatbot development framework - RASA and the most powerful, super-fast, and leading cloud graph database - TigerGraph.

NOTE: This help page will not go into the depth of RASA, TigerGraph functionalities. This help page will touch base and demo how TigerGraph can be integrated with RASA.

Technological Stack

Here is the high-level outline of the technological stack used in this demo project,

Putting things to work

Step-1: (RASA) Implement language models, user intents and backend actions

Beginner tutorial: This is a very good spot to learn about setting up a basic chatbot using RASA and understanding the core framework constructs.

Step-1a: Install RASA

Open a new terminal and setup RASA using the below commands:

  • $ python3 -m virtualenv -p python3 .
  • $ source bin/activate
  • $ pip install rasa

Step-1b: Create new RASA project

  • $ rasa init

After the execution of the above command, a new RASA 'Movie_Chatbot' project will be created in the current directory as shown below,

Below is a kick-off conversation with the newly created chatbot,

Ya, that's quite simple to create a chatbot now with RASA!

Step-1c: Define intents, stories, action triggers

Now, navigate to the project folder Movie_Chatbot/data and modify the default nlu.yml and rules.yml files by adding intents, rules for our movie recommendation business usecase as show below,

Step-1d: Install the TigerGraph python library using pip with the below command,

  • pip install pyTigerGraph

Step-1e: Define action endpoints

Now, navigate to the project folder Movie_Chatbot/actions and modify the actions.py file to include TigerGraph connection parameters and action definitions with the respective movie recommendation CSQL query as show below,

Add the defined action method to the domain.yml as shown below,

Here, 'RecommendMovies' is the name of the CSQL query in the tgcloud database which will discuss in detail in the next section.

With this step, we are done with the installation and configuration of the RASA chatbot.

Step-2: (TigerGraph) Setup TigerGraph database and querying APIs

Beginner tutorial: This is a very good spot to learn about setting up a tigergraph database on the cloud and implementing CSQL queries,

Step-2a: Setup tgcloud database

  • Go to, http://tgcloud.io/ and create a new account.

  • Activate the account.

  • Go to, "My Solutions" and click "Create Solution"

  • Select the starter kit as shown below then click Next twice.

  • Provide a solution name, password tags, and subdomain as needed, and then click 'Next'

  • Enter Submit and close your eyes for the magic!

And Yes!, the TigerGraph Movie recommendation Graph database is created. Buckle up a few more things to do!

  • Go to, GraphStudio and 'Load Data' by selecting the *.csv files and hit the 'play' button as shown below.

  • Once the data is loaded, data statistics should display a green 'FINISHED' message as shown below.

  • Go to, 'Write Queries' and implement the CSQL queries here as shown below,

  • Save the CSQL query and publish it using the 'up arrow' button.

  • Lets, test the query by running with a sample input as shown below,

All Set! The TigerGraph Database is up and running. Are we done? Almost! There is one more thing to do!

Step-2b: Configure secret token

  • Let's set up the secret key access to the cloud TigerGraph API as it is very crucial to ensure a secure way of providing access to the data.

  • Go to, Admin Dashboard->Users->Management and define a secret key as shown below,

  • NOTE: Please remember to copy the key to be used in the RASA connection configuration (Movie_ChatBot/actions/actions.py)

Step-3: (Web UI) Setting up a web ui for the RASA chatbot

  • In this work, we are using an open-source javascript-based chatbot UI to interact with the RASA solution we implemented in Step-1.

  • The RASA server endpoint is configured in the widget/static/Chat.js as shown below,

All right, we are one step close to seeing the working of the TigerGraph and RASA integration.

Step-4: (RASA+TigerGraph) Start RASA and run Actions

Run the below commands in separate terminals,

Terminal-1:

  • $ rasa train
  • $ rasa run -m models --enable-api --cors "*" --debug

Terminal-2:

  • $ rasa run actions

Step-5: (ChatBot UI) Open Chatbot User interface

Hit open widget/index.html to start interacting with the TigerBot movie recommendation engine!

Yes, we are DONE!

I hope this source is informative and helpful.

References:

Owner
Sudha Vijayakumar
Graduate student | Aspiring Software Engineer - Applied Data Science AI/ML/DL
Sudha Vijayakumar
A filler visualizer built using python

filler-visualizer 42 filler のログをビジュアライズしてスポーツさながら楽しむことができます! Usage (標準入力でvisualizer.pyに渡せばALL OK) 1. 既にあるログをビジュアライズする $ ./filler_vm -t 3 -p1 john_fill

Takumi Hara 1 Nov 04, 2021
Flexitext is a Python library that makes it easier to draw text with multiple styles in Matplotlib

Flexitext is a Python library that makes it easier to draw text with multiple styles in Matplotlib

Tomás Capretto 93 Dec 28, 2022
A set of three functions, useful in geographical calculations of different sorts

GreatCircle A set of three functions, useful in geographical calculations of different sorts. Available for PHP, Python, Javascript and Ruby. Live dem

72 Sep 30, 2022
A script written in Python that generate output custom color (HEX or RGB input to x1b hexadecimal)

ColorShell ─ 1.5 Planned for v2: setup.sh for setup alias This script converts HEX and RGB code to x1b x1b is code for colorize outputs, works on ou

Riley 4 Oct 31, 2021
WhatsApp Chat Analyzer is a WebApp and it can be used by anyone to analyze their chat. 😄

WhatsApp-Chat-Analyzer You can view the working project here. WhatsApp chat Analyzer is a WebApp where anyone either tech or non-tech person can analy

Prem Chandra Singh 26 Nov 02, 2022
Import, visualize, and analyze SpiderFoot OSINT data in Neo4j, a graph database

SpiderFoot Neo4j Tools Import, visualize, and analyze SpiderFoot OSINT data in Neo4j, a graph database Step 1: Installation NOTE: This installs the sf

Black Lantern Security 42 Dec 26, 2022
A shimmer pre-load component for Plotly Dash

dash-loading-shimmer A shimmer pre-load component for Plotly Dash Installation Get it with pip: pip install dash-loading-extras Or maybe you prefer Pi

Lucas Durand 4 Oct 12, 2022
Area-weighted venn-diagrams for Python/matplotlib

Venn diagram plotting routines for Python/Matplotlib Routines for plotting area-weighted two- and three-circle venn diagrams. Installation The simples

Konstantin Tretyakov 400 Dec 31, 2022
🗾 Streamlit Component for rendering kepler.gl maps

streamlit-keplergl 🗾 Streamlit Component for rendering kepler.gl maps in a streamlit app. 🎈 Live Demo 🎈 Installation pip install streamlit-keplergl

Christoph Rieke 39 Dec 14, 2022
Draw datasets from within Jupyter.

drawdata This small python app allows you to draw a dataset in a jupyter notebook. This should be very useful when teaching machine learning algorithm

vincent d warmerdam 505 Nov 27, 2022
Massively parallel self-organizing maps: accelerate training on multicore CPUs, GPUs, and clusters

Somoclu Somoclu is a massively parallel implementation of self-organizing maps. It exploits multicore CPUs, it is able to rely on MPI for distributing

Peter Wittek 239 Nov 10, 2022
The repository is my code for various types of data visualization cases based on the Matplotlib library.

ScienceGallery The repository is my code for various types of data visualization cases based on the Matplotlib library. It summarizes the code and cas

Warrick Xu 2 Apr 20, 2022
Visualizations of linear algebra algorithms for people who want a deep understanding

Visualising algorithms on symmetric matrices Examples QR algorithm and LR algorithm Here, we have a GIF animation of an interactive visualisation of t

ogogmad 3 May 05, 2022
ICS-Visualizer is an interactive Industrial Control Systems (ICS) network graph that contains up-to-date ICS metadata

ICS-Visualizer is an interactive Industrial Control Systems (ICS) network graph that contains up-to-date ICS metadata (Name, company, port, user manua

QeeqBox 2 Dec 13, 2021
GitHub Stats Visualizations : Transparent

GitHub Stats Visualizations : Transparent Generate visualizations of GitHub user and repository statistics using GitHub Actions. ⚠️ Disclaimer The pro

YuanYap 7 Apr 05, 2022
This plugin plots the time you spent on a tag as a histogram.

This plugin plots the time you spent on a tag as a histogram.

Tom Dörr 7 Sep 09, 2022
Keir&'s Visualizing Data on Life Expectancy

Keir's Visualizing Data on Life Expectancy Below is information on life expectancy in the United States from 1900-2017. You will also find information

9 Jun 06, 2022
Histogramming for analysis powered by boost-histogram

Hist Hist is an analyst-friendly front-end for boost-histogram, designed for Python 3.7+ (3.6 users get version 2.4). See what's new. Installation You

Scikit-HEP Project 97 Dec 25, 2022
Open-source demos hosted on Dash Gallery

Dash Sample Apps This repository hosts the code for over 100 open-source Dash apps written in Python or R. They can serve as a starting point for your

Plotly 2.7k Jan 07, 2023
EPViz is a tool to aid researchers in developing, validating, and reporting their predictive modeling outputs.

EPViz (EEG Prediction Visualizer) EPViz is a tool to aid researchers in developing, validating, and reporting their predictive modeling outputs. A lig

Jeff 2 Oct 19, 2022