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
Sprint planner considering JIRA issues and google calendar meetings schedule.

Sprint planner Sprint planner is a Python script for planning your Jira tasks based on your calendar availability. Installation Use the package manage

Apptension 2 Dec 05, 2021
A python script to visualise explain plans as a graph using graphviz

README Needs to be improved Prerequisites Need to have graphiz installed on the machine. Refer to https://graphviz.readthedocs.io/en/stable/manual.htm

Edward Mallia 1 Sep 28, 2021
Bcc2telegraf: An integration that sends ebpf-based bcc histogram metrics to telegraf daemon

bcc2telegraf bcc2telegraf is an integration that sends ebpf-based bcc histogram

Peter Bobrov 2 Feb 17, 2022
Pyan3 - Offline call graph generator for Python 3

Pyan takes one or more Python source files, performs a (rather superficial) static analysis, and constructs a directed graph of the objects in the combined source, and how they define or use each oth

Juha Jeronen 235 Jan 02, 2023
Python histogram library - histograms as updateable, fully semantic objects with visualization tools. [P]ython [HYST]ograms.

physt P(i/y)thon h(i/y)stograms. Inspired (and based on) numpy.histogram, but designed for humans(TM) on steroids(TM). The goal is to unify different

Jan Pipek 120 Dec 08, 2022
Visualize data of Vietnam's regions with interactive maps.

Plotting Vietnam Development Map This is my personal project that I use plotly to analyse and visualize data of Vietnam's regions with interactive map

1 Jun 26, 2022
Python library that makes it easy for data scientists to create charts.

Chartify Chartify is a Python library that makes it easy for data scientists to create charts. Why use Chartify? Consistent input data format: Spend l

Spotify 3.2k Jan 04, 2023
Realtime Web Apps and Dashboards for Python and R

H2O Wave Realtime Web Apps and Dashboards for Python and R New! R Language API Build and control Wave dashboards using R! New! Easily integrate AI/ML

H2O.ai 3.4k Jan 06, 2023
A little word cloud generator in Python

Linux macOS Windows PyPI word_cloud A little word cloud generator in Python. Read more about it on the blog post or the website. The code is tested ag

Andreas Mueller 9.2k Dec 30, 2022
GD-UltraHack - A Mod Menu for Geometry Dash. Specifically a MegahackV5 clone in Python. Only for Windows

GD UltraHack: The Mod Menu that Nobody asked for. This is a mod menu for the gam

zeo 1 Jan 05, 2022
Squidpy is a tool for the analysis and visualization of spatial molecular data.

Squidpy is a tool for the analysis and visualization of spatial molecular data. It builds on top of scanpy and anndata, from which it inherits modularity and scalability. It provides analysis tools t

Theis Lab 251 Dec 19, 2022
FURY - A software library for scientific visualization in Python

Free Unified Rendering in Python A software library for scientific visualization in Python. General Information • Key Features • Installation • How to

169 Dec 21, 2022
:art: Diagram as Code for prototyping cloud system architectures

Diagrams Diagram as Code. Diagrams lets you draw the cloud system architecture in Python code. It was born for prototyping a new system architecture d

MinJae Kwon 27.5k Dec 30, 2022
Visualize tensors in a plain Python REPL using Sparklines

Visualize tensors in a plain Python REPL using Sparklines

Shawn Presser 43 Sep 03, 2022
Define fortify and autoplot functions to allow ggplot2 to handle some popular R packages.

ggfortify This package offers fortify and autoplot functions to allow automatic ggplot2 to visualize statistical result of popular R packages. Check o

Sinhrks 504 Dec 23, 2022
Altair extension for saving charts in a variety of formats.

Altair Saver This packge provides extensions to Altair for saving charts to a variety of output types. Supported output formats are: .json/.vl.json: V

Altair 85 Dec 09, 2022
A Jupyter - Three.js bridge

pythreejs A Python / ThreeJS bridge utilizing the Jupyter widget infrastructure. Getting Started Installation Using pip: pip install pythreejs And the

Jupyter Widgets 844 Dec 27, 2022
An easy to use burndown chart generator for GitHub Project Boards.

Burndown Chart for GitHub Projects An easy to use burndown chart generator for GitHub Project Boards. Table of Contents Features Installation Assumpti

Joseph Hale 15 Dec 28, 2022
A Python function that makes flower plots.

Flower plot A Python 3.9+ function that makes flower plots. Installation This package requires at least Python 3.9. pip install

Thomas Roder 4 Jun 12, 2022
HW 2: Visualizing interesting datasets

HW 2: Visualizing interesting datasets Check out the project instructions here! Mean Earnings per Hour for Males and Females My first graph uses data

7 Oct 27, 2021