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
This is my favourite function - the Rastrigin function.

This is my favourite function - the Rastrigin function. What sparked my curiosity and interest in the function was its complexity in terms of many local optimum points, which makes it particularly in

1 Dec 27, 2021
termplotlib is a Python library for all your terminal plotting needs.

termplotlib termplotlib is a Python library for all your terminal plotting needs. It aims to work like matplotlib. Line plots For line plots, termplot

Nico Schlömer 553 Dec 30, 2022
A blender import/export system for Defold

defold-blender-export A Blender export system for the Defold game engine. Setup Notes There are no exhaustive documents for this tool yet. Its just no

David Lannan 27 Dec 30, 2022
Extract data from ThousandEyes REST API and visualize it on your customized Grafana Dashboard.

ThousandEyes Grafana Dashboard Extract data from the ThousandEyes REST API and visualize it on your customized Grafana Dashboard. Deploy Grafana, Infl

Flo Pachinger 16 Nov 26, 2022
A small timeseries transformation API built on Flask and Pandas

#Mcflyin ###A timeseries transformation API built on Pandas and Flask This is a small demo of an API to do timeseries transformations built on Flask a

Rob Story 84 Mar 25, 2022
Shaded 😎 quantile plots

shadyquant 😎 This python package allows you to quantile and plot lines where you have multiple samples, typically for visualizing uncertainty. Your d

Mehrad Ansari 13 Sep 29, 2022
Automate the case review on legal case documents and find the most critical cases using network analysis

Automation on Legal Court Cases Review This project is to automate the case review on legal case documents and find the most critical cases using netw

Yi Yin 7 Dec 28, 2022
Simple, realtime visualization of neural network training performance.

pastalog Simple, realtime visualization server for training neural networks. Use with Lasagne, Keras, Tensorflow, Torch, Theano, and basically everyth

Rewon Child 416 Dec 29, 2022
clock_plot provides a simple way to visualize timeseries data, mapping 24 hours onto the 360 degrees of a polar plot

clock_plot clock_plot provides a simple way to visualize timeseries data mapping 24 hours onto the 360 degrees of a polar plot. For usage, please see

12 Aug 24, 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
plotly scatterplots which show molecule images on hover!

molplotly Plotly scatterplots which show molecule images on hovering over the datapoints! Required packages: pandas rdkit jupyter_dash ➡️ See example.

150 Dec 28, 2022
A deceptively simple plotting library for Streamlit

🍅 Plost A deceptively simple plotting library for Streamlit. Because you've been writing plots wrong all this time. Getting started pip install plost

Thiago Teixeira 192 Dec 29, 2022
Painlessly create beautiful matplotlib plots.

Announcement Thank you to everyone who has used prettyplotlib and made it what it is today! Unfortunately, I no longer have the bandwidth to maintain

Olga Botvinnik 1.6k Jan 06, 2023
A visualization tool made in Pygame for various pathfinding algorithms.

Pathfinding-Visualizer 🚀 A visualization tool made in Pygame for various pathfinding algorithms. Pathfinding is closely related to the shortest path

Aysha sana 7 Jul 09, 2022
Automatically visualize your pandas dataframe via a single print! 📊 💡

A Python API for Intelligent Visual Discovery Lux is a Python library that facilitate fast and easy data exploration by automating the visualization a

Lux 4.3k Dec 28, 2022
eoplatform is a Python package that aims to simplify Remote Sensing Earth Observation by providing actionable information on a wide swath of RS platforms and provide a simple API for downloading and visualizing RS imagery

An Earth Observation Platform Earth Observation made easy. Report Bug | Request Feature About eoplatform is a Python package that aims to simplify Rem

Matthew Tralka 4 Aug 11, 2022
A tool to plot and execute Rossmos's Formula, that helps to catch serial criminals using mathematics

Rossmo Plotter A tool to plot and execute Rossmos's Formula using python, that helps to catch serial criminals using mathematics Author: Amlan Saha Ku

Amlan Saha Kundu 3 Aug 29, 2022
Python code for solving 3D structural problems using the finite element method

3DFEM Python 3D finite element code This python code allows for solving 3D structural problems using the finite element method. New features will be a

Rémi Capillon 6 Sep 29, 2022
Lightweight data validation and adaptation Python library.

Valideer Lightweight data validation and adaptation library for Python. At a Glance: Supports both validation (check if a value is valid) and adaptati

Podio 258 Nov 22, 2022
Complex heatmaps are efficient to visualize associations between different sources of data sets and reveal potential patterns.

Make Complex Heatmaps Complex heatmaps are efficient to visualize associations between different sources of data sets and reveal potential patterns. H

Zuguang Gu 973 Jan 09, 2023