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
Pytorch Implementation of Interaction Networks for Learning about Objects, Relations and Physics

Interaction-Network-Pytorch Pytorch Implementraion of Interaction Networks for Learning about Objects, Relations and Physics. Interaction Network is a

117 Nov 05, 2022
Robust & Reliable Route Recommendation on Road Networks

NeuroMLR: Robust & Reliable Route Recommendation on Road Networks This repository is the official implementation of NeuroMLR: Robust & Reliable Route

4 Dec 20, 2022
Can we learn gradients by Hamiltonian Neural Networks?

Can we learn gradients by Hamiltonian Neural Networks? This project was carried out as part of the Optimization for Machine Learning course (CS-439) a

2 Aug 22, 2022
TrackFormer: Multi-Object Tracking with Transformers

TrackFormer: Multi-Object Tracking with Transformers This repository provides the official implementation of the TrackFormer: Multi-Object Tracking wi

Tim Meinhardt 321 Dec 29, 2022
1st Solution For NeurIPS 2021 Competition on ML4CO Dual Task

KIDA: Knowledge Inheritance in Data Aggregation This project releases our 1st place solution on NeurIPS2021 ML4CO Dual Task. Slide and model weights a

MEGVII Research 24 Sep 08, 2022
The code for 'Deep Residual Fourier Transformation for Single Image Deblurring'

Deep Residual Fourier Transformation for Single Image Deblurring Xintian Mao, Yiming Liu, Wei Shen, Qingli Li and Yan Wang code will be released soon

145 Dec 13, 2022
Official implementation of paper Gradient Matching for Domain Generalization

Gradient Matching for Domain Generalisation This is the official PyTorch implementation of Gradient Matching for Domain Generalisation. In our paper,

94 Dec 23, 2022
It's a powerful version of linebot

CTPS-FINAL Linbot-sever.py 主程式 Algorithm.py 推薦演算法,媒合餐廳端資料與顧客端資料 config.ini 儲存 channel-access-token、channel-secret 資料 Preface 生活在成大將近4年,我們每天的午餐時間看著形形色色

1 Oct 17, 2022
YOLOv2 in PyTorch

YOLOv2 in PyTorch NOTE: This project is no longer maintained and may not compatible with the newest pytorch (after 0.4.0). This is a PyTorch implement

Long Chen 1.5k Jan 02, 2023
Open CV - Convert a picture to look like a cartoon sketch in python

Use the video https://www.youtube.com/watch?v=k7cVPGpnels for initial learning.

Sammith S Bharadwaj 3 Jan 29, 2022
A annotation of yolov5-5.0

代码版本:0714 commit #4000 $ git clone https://github.com/ultralytics/yolov5 $ cd yolov5 $ git checkout 720aaa65c8873c0d87df09e3c1c14f3581d4ea61 这个代码只是注释版

Laughing 229 Dec 17, 2022
Context Axial Reverse Attention Network for Small Medical Objects Segmentation

CaraNet: Context Axial Reverse Attention Network for Small Medical Objects Segmentation This repository contains the implementation of a novel attenti

401 Dec 23, 2022
Chess reinforcement learning by AlphaGo Zero methods.

About Chess reinforcement learning by AlphaGo Zero methods. This project is based on these main resources: DeepMind's Oct 19th publication: Mastering

Samuel 2k Dec 29, 2022
The dataset of tweets pulling from Twitters with keyword: Hydroxychloroquine, location: US, Time: 2020

HCQ_Tweet_Dataset: FREE to Download. Keywords: HCQ, hydroxychloroquine, tweet, twitter, COVID-19 This dataset is associated with the paper "Understand

2 Mar 16, 2022
Covid-19 Test AI (Deep Learning - NNs) Software. Accuracy is the %96.5, loss is the 0.09 :)

Covid-19 Test AI (Deep Learning - NNs) Software I developed a segmentation algorithm to understand whether Covid-19 Test Photos are positive or negati

Emirhan BULUT 28 Dec 04, 2021
A Flow-based Generative Network for Speech Synthesis

WaveGlow: a Flow-based Generative Network for Speech Synthesis Ryan Prenger, Rafael Valle, and Bryan Catanzaro In our recent paper, we propose WaveGlo

NVIDIA Corporation 2k Dec 26, 2022
Lua-parser-lark - An out-of-box Lua parser written in Lark

An out-of-box Lua parser written in Lark Such parser handles a relaxed version o

Taine Zhao 2 Jul 19, 2022
Multimodal Descriptions of Social Concepts: Automatic Modeling and Detection of (Highly Abstract) Social Concepts evoked by Art Images

MUSCO - Multimodal Descriptions of Social Concepts Automatic Modeling of (Highly Abstract) Social Concepts evoked by Art Images This project aims to i

0 Aug 22, 2021
Implementation of 'lightweight' GAN, proposed in ICLR 2021, in Pytorch. High resolution image generations that can be trained within a day or two

512x512 flowers after 12 hours of training, 1 gpu 256x256 flowers after 12 hours of training, 1 gpu Pizza 'Lightweight' GAN Implementation of 'lightwe

Phil Wang 1.5k Jan 02, 2023
Offline Multi-Agent Reinforcement Learning Implementations: Solving Overcooked Game with Data-Driven Method

Overcooked-AI We suppose to apply traditional offline reinforcement learning technique to multi-agent algorithm. In this repository, we implemented be

Baek In-Chang 14 Sep 16, 2022