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 paper “Unbiased Scene Graph Generation from Biased Training”

A new codebase for popular Scene Graph Generation methods (2020). Visualization & Scene Graph Extraction on custom images/datasets are provided. It's also a PyTorch implementation of paper “Unbiased

Kaihua Tang 824 Jan 03, 2023
Code Repository for The Kaggle Book, Published by Packt Publishing

The Kaggle Book Data analysis and machine learning for competitive data science Code Repository for The Kaggle Book, Published by Packt Publishing "Lu

Packt 1.6k Jan 07, 2023
Implementation / replication of DALL-E, OpenAI's Text to Image Transformer, in Pytorch

DALL-E in Pytorch Implementation / replication of DALL-E, OpenAI's Text to Image Transformer, in Pytorch. It will also contain CLIP for ranking the ge

Phil Wang 5k Jan 04, 2023
unet for image segmentation

Implementation of deep learning framework -- Unet, using Keras The architecture was inspired by U-Net: Convolutional Networks for Biomedical Image Seg

zhixuhao 4.1k Dec 31, 2022
3D detection and tracking viewer (visualization) for kitti & waymo dataset

3D detection and tracking viewer (visualization) for kitti & waymo dataset

222 Jan 08, 2023
The Official Repository for "Generalized OOD Detection: A Survey"

Generalized Out-of-Distribution Detection: A Survey 1. Overview This repository is with our survey paper: Title: Generalized Out-of-Distribution Detec

Jingkang Yang 338 Jan 03, 2023
YOLOX_AUDIO is an audio event detection model based on YOLOX

YOLOX_AUDIO is an audio event detection model based on YOLOX, an anchor-free version of YOLO. This repo is an implementated by PyTorch. Main goal of YOLOX_AUDIO is to detect and classify pre-defined

intflow Inc. 77 Dec 19, 2022
Cancer-and-Tumor-Detection-Using-Inception-model - In this repo i am gonna show you how i did cancer/tumor detection in lungs using deep neural networks, specifically here the Inception model by google.

Cancer-and-Tumor-Detection-Using-Inception-model In this repo i am gonna show you how i did cancer/tumor detection in lungs using deep neural networks

Deepak Nandwani 1 Jan 01, 2022
Image process framework based on plugin like imagej, it is esay to glue with scipy.ndimage, scikit-image, opencv, simpleitk, mayavi...and any libraries based on numpy

Introduction ImagePy is an open source image processing framework written in Python. Its UI interface, image data structure and table data structure a

ImagePy 1.2k Dec 29, 2022
A DeepStack custom model for detecting common objects in dark/night images and videos.

DeepStack_ExDark This repository provides a custom DeepStack model that has been trained and can be used for creating a new object detection API for d

MOSES OLAFENWA 98 Dec 24, 2022
Learning Confidence for Out-of-Distribution Detection in Neural Networks

Learning Confidence Estimates for Neural Networks This repository contains the code for the paper Learning Confidence for Out-of-Distribution Detectio

235 Jan 05, 2023
An Industrial Grade Federated Learning Framework

DOC | Quick Start | 中文 FATE (Federated AI Technology Enabler) is an open-source project initiated by Webank's AI Department to provide a secure comput

Federated AI Ecosystem 4.8k Jan 09, 2023
Official repository for the paper "Self-Supervised Models are Continual Learners" (CVPR 2022)

Self-Supervised Models are Continual Learners This is the official repository for the paper: Self-Supervised Models are Continual Learners Enrico Fini

Enrico Fini 73 Dec 18, 2022
Official repository for the paper "Going Beyond Linear Transformers with Recurrent Fast Weight Programmers"

Recurrent Fast Weight Programmers This is the official repository containing the code we used to produce the experimental results reported in the pape

IDSIA 36 Nov 15, 2022
[ICCV 2021] Counterfactual Attention Learning for Fine-Grained Visual Categorization and Re-identification

Counterfactual Attention Learning Created by Yongming Rao*, Guangyi Chen*, Jiwen Lu, Jie Zhou This repository contains PyTorch implementation for ICCV

Yongming Rao 90 Dec 31, 2022
Python code for loading the Aschaffenburg Pose Dataset.

Aschaffenburg Pose Dataset (APD) This repository contains Python code for loading and filtering the Aschaffenburg Pose Dataset. The dataset itself and

1 Nov 26, 2021
Galileo library for large scale graph training by JD

近年来,图计算在搜索、推荐和风控等场景中获得显著的效果,但也面临超大规模异构图训练,与现有的深度学习框架Tensorflow和PyTorch结合等难题。 Galileo(伽利略)是一个图深度学习框架,具备超大规模、易使用、易扩展、高性能、双后端等优点,旨在解决超大规模图算法在工业级场景的落地难题,提

JD Galileo Team 128 Nov 29, 2022
Unofficial implementation of "Coordinate Attention for Efficient Mobile Network Design"

Unofficial implementation of "Coordinate Attention for Efficient Mobile Network Design". CoordAttention tensorflow slim

Billy 9 Aug 22, 2022
Universal Adversarial Triggers for Attacking and Analyzing NLP (EMNLP 2019)

Universal Adversarial Triggers for Attacking and Analyzing NLP This is the official code for the EMNLP 2019 paper, Universal Adversarial Triggers for

Eric Wallace 248 Dec 17, 2022
An open source AutoML toolkit for automate machine learning lifecycle, including feature engineering, neural architecture search, model compression and hyper-parameter tuning.

NNI Doc | 简体中文 NNI (Neural Network Intelligence) is a lightweight but powerful toolkit to help users automate Feature Engineering, Neural Architecture

Microsoft 12.4k Dec 31, 2022