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
Calibrate your listeners! Robust communication-based training for pragmatic speakers. Findings of EMNLP 2021.

Calibrate your listeners! Robust communication-based training for pragmatic speakers Rose E. Wang, Julia White, Jesse Mu, Noah D. Goodman Findings of

Rose E. Wang 3 Apr 02, 2022
For holding anime-related object classification and detection models

Animesion An end-to-end framework for anime-related object classification, detection, segmentation, and other models. Update: 01/22/2020. Due to time-

Edwin Arkel Rios 72 Nov 30, 2022
This repo contains the code and data used in the paper "Wizard of Search Engine: Access to Information Through Conversations with Search Engines"

Wizard of Search Engine: Access to Information Through Conversations with Search Engines by Pengjie Ren, Zhongkun Liu, Xiaomeng Song, Hongtao Tian, Zh

19 Oct 27, 2022
AdamW optimizer and cosine learning rate annealing with restarts

AdamW optimizer and cosine learning rate annealing with restarts This repository contains an implementation of AdamW optimization algorithm and cosine

Maksym Pyrozhok 133 Dec 20, 2022
Project page for End-to-end Recovery of Human Shape and Pose

End-to-end Recovery of Human Shape and Pose Angjoo Kanazawa, Michael J. Black, David W. Jacobs, Jitendra Malik CVPR 2018 Project Page Requirements Pyt

1.4k Dec 29, 2022
Code release of paper "Deep Multi-View Stereo gone wild"

Deep MVS gone wild Pytorch implementation of "Deep MVS gone wild" (Paper | website) This repository provides the code to reproduce the experiments of

François Darmon 53 Dec 24, 2022
PyTorch implementations of neural network models for keyword spotting

Honk: CNNs for Keyword Spotting Honk is a PyTorch reimplementation of Google's TensorFlow convolutional neural networks for keyword spotting, which ac

Castorini 475 Dec 15, 2022
Code for the upcoming CVPR 2021 paper

The Temporal Opportunist: Self-Supervised Multi-Frame Monocular Depth Jamie Watson, Oisin Mac Aodha, Victor Prisacariu, Gabriel J. Brostow and Michael

Niantic Labs 496 Dec 30, 2022
Unified Instance and Knowledge Alignment Pretraining for Aspect-based Sentiment Analysis

Unified Instance and Knowledge Alignment Pretraining for Aspect-based Sentiment Analysis Requirements python 3.7 pytorch-gpu 1.7 numpy 1.19.4 pytorch_

12 Oct 29, 2022
To Design and Implement Logistic Regression to Classify Between Benign and Malignant Cancer Types

To Design and Implement Logistic Regression to Classify Between Benign and Malignant Cancer Types, from a Database Taken From Dr. Wolberg reports his Clinic Cases.

Astitva Veer Garg 1 Jul 31, 2022
Deep Q Learning with OpenAI Gym and Pokemon Showdown

pokemon-deep-learning An openAI gym project for pokemon involving deep q learning. Made by myself, Sam Little, and Layton Webber. This code captures g

2 Dec 22, 2021
gym-anm is a framework for designing reinforcement learning (RL) environments that model Active Network Management (ANM) tasks in electricity distribution networks.

gym-anm is a framework for designing reinforcement learning (RL) environments that model Active Network Management (ANM) tasks in electricity distribution networks. It is built on top of the OpenAI G

Robin Henry 99 Dec 12, 2022
HW3 ― GAN, ACGAN and UDA

HW3 ― GAN, ACGAN and UDA In this assignment, you are given datasets of human face and digit images. You will need to implement the models of both GAN

grassking100 1 Dec 13, 2021
Pytorch implement of 'Unmixing based PAN guided fusion network for hyperspectral imagery'

Pgnet There's a improved version compared with the publication in Tgrs with the modification in the deduction of the PDIN block: https://arxiv.org/abs

5 Jul 01, 2022
CVPR2022 paper "Dense Learning based Semi-Supervised Object Detection"

[CVPR2022] DSL: Dense Learning based Semi-Supervised Object Detection DSL is the first work on Anchor-Free detector for Semi-Supervised Object Detecti

Bhchen 69 Dec 08, 2022
Code for our NeurIPS 2021 paper 'Exploiting the Intrinsic Neighborhood Structure for Source-free Domain Adaptation'

Exploiting the Intrinsic Neighborhood Structure for Source-free Domain Adaptation (NeurIPS 2021) Code for our NeurIPS 2021 paper 'Exploiting the Intri

Shiqi Yang 53 Dec 25, 2022
Python Tensorflow 2 scripts for detecting objects of any class in an image without knowing their label.

Tensorflow-Mobile-Generic-Object-Localizer Python Tensorflow 2 scripts for detecting objects of any class in an image without knowing their label. Ori

Ibai Gorordo 11 Nov 15, 2022
Breaking Shortcut: Exploring Fully Convolutional Cycle-Consistency for Video Correspondence Learning

Breaking Shortcut: Exploring Fully Convolutional Cycle-Consistency for Video Correspondence Learning Yansong Tang *, Zhenyu Jiang *, Zhenda Xie *, Yue

Zhenyu Jiang 12 Nov 16, 2022
Code and data for ACL2021 paper Cross-Lingual Abstractive Summarization with Limited Parallel Resources.

Multi-Task Framework for Cross-Lingual Abstractive Summarization (MCLAS) The code for ACL2021 paper Cross-Lingual Abstractive Summarization with Limit

Yu Bai 43 Nov 07, 2022
Continuous Diffusion Graph Neural Network

We present Graph Neural Diffusion (GRAND) that approaches deep learning on graphs as a continuous diffusion process and treats Graph Neural Networks (GNNs) as discretisations of an underlying PDE.

Twitter Research 227 Jan 05, 2023