Politecnico of Turin Thesis: "Implementation and Evaluation of an Educational Chatbot based on NLP Techniques"

Overview

THESIS_CAIRONE_FIORENTINO

Politecnico of Turin Thesis: "Implementation and Evaluation of an Educational Chatbot based on NLP Techniques"

GENERATE TOKEN SLACK

NB: REMEMBER TO REGENERATE SLACK TOKENS AND CHANNEL ID IF ARE DISABLE (SEE THESIS PDF)

  • Go on your Slack App ( App Slack )-> select your app or create new -> Settings -> Install App -> (regenerate two tokens) -> Copy Tokens in actions/Constants.py and credentials.yml files.

RASA - LOCAL MODE

Components Installation

  • Writing in Anaconda console this command:
    • conda create --name venv python==3.8.0
    • conda activate venv
    • conda install ujson tensorflow
    • pip install rasa
    • pip install rasa[spacy] for SPACY configuration
    • pip install rasa[trasformers] for BERT configuration
    • rasa init if you want to create new project

MORE INFO: See this video: link

Code Execution

  • First, in TESI_POLI_POBOT directory do the training in anaconda console with venv activate:

    • rasa train --config configs/{file_cofiguration}.yml --fixed-model-name {model_name}
  • After run server rasa:

  • rasa run --connector slack --model {model_name} --debug

  • In an other prompr run server rasa ACTIONS:

  • rasa run actions --action actions --debug

  • If you want,to test locally the intent classification, run in Anaconda console:

    • rasa train --config configs/{file_cofiguration}.yml --fixed-model-name {model_name}
    • rasa shell --model {model_name}

Rasa Bot - Slack Connection

  • after training and running the server in Anaconda console (see ## Execution of code paragraph):
    • in BOT_RASA/ngrok directory run this command (in console prompt):
      • ngrok http 5005 to create a tunnel for localhost:5005 address:
      • select the forwarding address choose to ngrok ({address} = http://<number_code>.ngrok.io)
      • in Slack App link save the address (selecting in Features menu):
        • Interactivity & Shortcut > Request URL: ({address}/webhooks/slack/webhook) > Save Changes
        • OAuth & Permissions > Redirect URLs > Add : ({address}/webhooks/slack/webhook) > Save URLs
        • Event Subscriptions > Enable Events (Request URL) > Change: ({address}/webhooks/slack/webhook) > Save Changes
      • expired time of ngrok address: 2 hours. (when we will use a public address, ngrok will become USELESS)
  • tokens bot save as environment variable in PC server (for security issue)
  • Slack bot: link

To Connect also the ACTION Server Rasa:

  • ngrok http 5055 to create a tunnel for localhost:5055
  • In endpoints.yml modify url of action_endpoint: {address}/webhook

RASA X

Components Installation

  • Writing in Anaconda console this command:
    • conda create --name venv python==3.9.0
    • conda activate venv
    • conda install ujson tensorflow
    • pip install rasa[spacy] for SPACY configuration
    • pip install rasa[trasformers] for BERT configuration
    • pip install --upgrade pip==20.0.1 pip3 install rasa-x --extra-index-url https://pypi.rasa.com/simple pip install --upgrade pip

Code Execution

  • First, in TESI_POLI_POBOT directory do the training in anaconda console with venv activate:

    • set PYTHONUTF8=1
    • rasa x --connector slack --config configs/{file_cofiguration}.yml
  • In an other prompt run server rasa ACTIONS:

  • rasa run actions --action actions --debug

Rasa Bot - Slack Connection

  • after training and running the server in Anaconda console (see ## Execution of code paragraph):
    • in BOT_RASA/ngrok directory run this command (in console prompt):
      • ngrok http 5005 to create a tunnel for localhost:5005 address:
      • select the forwarding address choose to ngrok ({address} = http://<number_code>.ngrok.io)
      • in Slack App link save the address (selecting in Features menu):
        • Interactivity & Shortcut > Request URL: ({address}/webhooks/slack/webhook) > Save Changes
        • OAuth & Permissions > Redirect URLs > Add : ({address}/webhooks/slack/webhook) > Save URLs
        • Event Subscriptions > Enable Events (Request URL) > Change: ({address}/webhooks/slack/webhook) > Save Changes
      • expired time of ngrok address: 2 hours. (when we will use a public address, ngrok will become USELESS)
  • tokens bot save as environment variable in PC server (for security issue)
  • Slack bot: link

To Connect also the ACTION Server Rasa:

  • ngrok http 5055 to create a tunnel for localhost:5055
  • In endpoints.yml modify url of action_endpoint: {address}/webhook

To Connect also the ACTION Server Rasa X:

  • ngrok http 5055 to create a tunnel for localhost:5002
  • In credentials.yml modify url of rasa: {address}/api

RASA - DOCKER MODE

Code Execution

If is the first time, run this commands:

docker volume create db-volume
docker-compose up -d
docker-compose down
docker-compose up -d
python rasa_x_commands.py create --update admin me <password_rasa_server> (i.e. password)
docker-compose down
docker-compose up -d

Otherwise, in TESI_POLI_POBOT directory in console run only this command:

  • docker-compose up -d

Rasa Bot - Slack Connection

After all container is in running mode, in web browser go in `http:://localhost:80' and insert the password choose the first time. (i.e. password)

If rasa x server not contain NLU data (possible first time) you can upload the file directly using interface of rasa x server in Training -> NLU data / Stories / Rules / Configuration (copy and paste the content of config choose in TESI_POLI_POBOT directory)

If you want to connect to slack:

  • after training and running the server in Anaconda console (see ## Execution of code paragraph):
    • in BOT_RASA/ngrok directory run this command (in console prompt):
      • ngrok http 80 to create a tunnel for localhost:80 address:
      • select the forwarding address choose to ngrok ({address} = http://<number_code>.ngrok.io)
      • in Slack App link save the address (selecting in Features menu):
        • Interactivity & Shortcut > Request URL: ({address}/core/webhooks/slack/webhook) > Save Changes
        • OAuth & Permissions > Redirect URLs > Add : ({address}/core/webhooks/slack/webhook) > Save URLs
        • Event Subscriptions > Enable Events (Request URL) > Change: ({address}/core/webhooks/slack/webhook) > Save Changes
      • expired time of ngrok address: 2 hours. (when we will use a public address, ngrok will become USELESS)
  • tokens bot save as environment variable in PC server (for security issue)
  • Slack bot: link

RASA - TEST DATA

Test stories in tests directory

  • if you want tests stories with cross-validation:
    • rasa train --config configs/{file_cofiguration}.yml --fixed-model-name {model_name} (if model does not exist)
    • rasa test --config configs/{file_cofiguration}.yml --cross-validation --runs {time_runs} --folds {num_folds} --out {dir_out} --model {model_name}

Test NLU data

  • if you want test only the NLU data splitted:

    • rasa train nlu --nlu train_test_split/training_data.yml --config configs/{file_cofiguration}.yml --fixed-model-name ./models_NLU/{model_name} (if model does not exist)
    • rasa test nlu --nlu train_test_split/test_data.yml --out {dir_out} --model ./models_NLU/{model_name}
  • if you want test only the NLU data totally:

    • rasa train nlu --config configs/{file_cofiguration}.yml --fixed-model-name {model_name} (if model does not exist)
    • rasa test nlu --nlu train_test_split/test_data.yml --out {dir_out} --model {model_name}

Test CORE data

  • if you want test only the CORE data:
    • rasa train --config configs/{file_cofiguration}.yml --fixed-model-name {model_name} (if model does not exist)
    • rasa test core --stories tests/test_stories.yml --out {dir_out} --model {model_name}
Owner
cairone_fiorentino97
cairone_fiorentino97
Global Rhythm Style Transfer Without Text Transcriptions

Global Prosody Style Transfer Without Text Transcriptions This repository provides a PyTorch implementation of AutoPST, which enables unsupervised glo

Kaizhi Qian 193 Dec 30, 2022
LSTM built using Keras Python package to predict time series steps and sequences. Includes sin wave and stock market data

LSTM Neural Network for Time Series Prediction LSTM built using the Keras Python package to predict time series steps and sequences. Includes sine wav

Jakob Aungiers 4.1k Jan 02, 2023
Creating a Linear Program Solver by Implementing the Simplex Method in Python with NumPy

Creating a Linear Program Solver by Implementing the Simplex Method in Python with NumPy Simplex Algorithm is a popular algorithm for linear programmi

Reda BELHAJ 2 Oct 12, 2022
Simple node deletion tool for onnx.

snd4onnx Simple node deletion tool for onnx. I only test very miscellaneous and limited patterns as a hobby. There are probably a large number of bugs

Katsuya Hyodo 6 May 15, 2022
Learned Initializations for Optimizing Coordinate-Based Neural Representations

Learned Initializations for Optimizing Coordinate-Based Neural Representations Project Page | Paper Matthew Tancik*1, Ben Mildenhall*1, Terrance Wang1

Matthew Tancik 127 Jan 03, 2023
ReAct: Out-of-distribution Detection With Rectified Activations

ReAct: Out-of-distribution Detection With Rectified Activations This is the source code for paper ReAct: Out-of-distribution Detection With Rectified

38 Dec 05, 2022
Official Pytorch Implementation of: "ImageNet-21K Pretraining for the Masses"(2021) paper

ImageNet-21K Pretraining for the Masses Paper | Pretrained models Official PyTorch Implementation Tal Ridnik, Emanuel Ben-Baruch, Asaf Noy, Lihi Zelni

574 Jan 02, 2023
Official PyTorch implementation of "RMGN: A Regional Mask Guided Network for Parser-free Virtual Try-on" (IJCAI-ECAI 2022)

RMGN-VITON RMGN: A Regional Mask Guided Network for Parser-free Virtual Try-on In IJCAI-ECAI 2022(short oral). [Paper] [Supplementary Material] Abstra

27 Dec 01, 2022
Object-Centric Learning with Slot Attention

Slot Attention This is a re-implementation of "Object-Centric Learning with Slot Attention" in PyTorch (https://arxiv.org/abs/2006.15055). Requirement

Untitled AI 72 Jan 02, 2023
The 2nd place solution of 2021 google landmark retrieval on kaggle.

Google_Landmark_Retrieval_2021_2nd_Place_Solution The 2nd place solution of 2021 google landmark retrieval on kaggle. Environment We use cuda 11.1/pyt

229 Dec 13, 2022
Scripts for training an AI to play the endless runner Subway Surfers using a supervised machine learning approach by imitation and a convolutional neural network (CNN) for image classification

About subwAI subwAI - a project for training an AI to play the endless runner Subway Surfers using a supervised machine learning approach by imitation

82 Jan 01, 2023
Official pytorch implementation of Active Learning for deep object detection via probabilistic modeling (ICCV 2021)

Active Learning for Deep Object Detection via Probabilistic Modeling This repository is the official PyTorch implementation of Active Learning for Dee

NVIDIA Research Projects 130 Jan 06, 2023
Faster Convex Lipschitz Regression

Faster Convex Lipschitz Regression This reepository provides a python implementation of our Faster Convex Lipschitz Regression algorithm with GPU and

Ali Siahkamari 0 Nov 19, 2021
Pytorch Implementation of Auto-Compressing Subset Pruning for Semantic Image Segmentation

Pytorch Implementation of Auto-Compressing Subset Pruning for Semantic Image Segmentation Introduction ACoSP is an online pruning algorithm that compr

Merantix 8 Dec 07, 2022
Only valid pull requests will be allowed. Use python only and readme changes will not be accepted.

❌ This repo is excluded from hacktoberfest This repo is for python beginners and contains lot of beginner python projects for practice. You can also s

Prajjwal Pathak 50 Dec 28, 2022
YOLTv4 builds upon YOLT and SIMRDWN, and updates these frameworks to use the most performant version of YOLO, YOLOv4

YOLTv4 builds upon YOLT and SIMRDWN, and updates these frameworks to use the most performant version of YOLO, YOLOv4. YOLTv4 is designed to detect objects in aerial or satellite imagery in arbitraril

Adam Van Etten 161 Jan 06, 2023
Code for Blind Image Decomposition (BID) and Blind Image Decomposition network (BIDeN).

arXiv, porject page, paper Blind Image Decomposition (BID) Blind Image Decomposition is a novel task. The task requires separating a superimposed imag

64 Dec 20, 2022
Tensorflow 2.x based implementation of EDSR, WDSR and SRGAN for single image super-resolution

Single Image Super-Resolution with EDSR, WDSR and SRGAN A Tensorflow 2.x based implementation of Enhanced Deep Residual Networks for Single Image Supe

Martin Krasser 1.3k Jan 06, 2023
Combinatorial model of ligand-receptor binding

Combinatorial model of ligand-receptor binding The binding of ligands to receptors is the starting point for many import signal pathways within a cell

Mobolaji Williams 0 Jan 09, 2022
Code for Generating Disentangled Arguments with Prompts: A Simple Event Extraction Framework that Works

GDAP Code for Generating Disentangled Arguments with Prompts: A Simple Event Extraction Framework that Works Environment Python (verified: v3.8) CUDA

45 Oct 29, 2022