The repo contains the code to train and evaluate a system which extracts relations and explanations from dialogue.

Related tags

Deep LearningD-REX
Overview

The repo contains the code to train and evaluate a system which extracts relations and explanations from dialogue.

How do I cite D-REX?

For now, cite the Arxiv paper

@article{albalak2021drex,
      title={D-REX: Dialogue Relation Extraction with Explanations}, 
      author={Alon Albalak and Varun Embar and Yi-Lin Tuan and Lise Getoor and William Yang Wang},
      journal={arXiv preprint arXiv:2109.05126},
      year={2021},
}

To train the full system:

GPU=0
bash train_drex_system.sh $GPU

Notes:

  • The training script is set up to work with an NVIDIA Titan RTX (24Gb memory, mixed-precision)
  • To train on a GPU with less memory, adjust the GPU_BATCH_SIZE parameter in train_drex_system.sh to match your memory limit.
  • Training the full system takes ~24 hours on a single NVIDIA Titan RTX

To test the trained system:

GPU=0
bash test_drex_system.sh $GPU

To train/test individual modules:

  • Relation Extraction Model -
    • Training:
      GPU=0
      MODEL_PATH=relation_extraction_model
      mkdir $MODEL_PATH
      CUDA_VISIBLE_DEVICES=$GPU python3 train_relation_extraction_model.py \
          --model_class=relation_extraction_roberta \
          --model_name_or_path=roberta-base \
          --base_model=roberta-base \
          --effective_batch_size=30 \
          --gpu_batch_size=30 \
          --fp16 \
          --output_dir=$MODEL_PATH \
          --relation_extraction_pretraining \
          > $MODEL_PATH/train_outputs.log
    • Testing:
      GPU=0
      MODEL_PATH=relation_extraction_model
      BEST_MODEL=$(ls $MODEL_PATH/F1* -d | sort -r | head -n 1)
      THRESHOLD1=$(echo $BEST_MODEL | grep -o "T1.....")
      THRESHOLD1=${THRESHOLD1: -2}
      THRESHOLD2=$(echo $BEST_MODEL | grep -o "T2.....")
      THRESHOLD2=${THRESHOLD2: -2}
      CUDA_VISIBLE_DEVICES=0 python3 test_relation_extraction_model.py \
          --model_class=relation_extraction_roberta \
          --model_name_or_path=$BEST_MODEL \
          --base_model=roberta-base \
          --relation_extraction_pretraining \
          --threshold1=$THRESHOLD1 \
          --threshold2=$THRESHOLD2 \
          --data_split=test
  • Explanation Extraction Model -
    • Training:
      GPU=0
      MODEL_PATH=explanation_extraction_model
      mkdir $MODEL_PATH
      CUDA_VISIBLE_DEVICES=$GPU python3 train_explanation_policy.py \
          --model_class=explanation_policy_roberta \
          --model_name_or_path=roberta-base \
          --base_model=roberta-base \
          --effective_batch_size=30 \
          --gpu_batch_size=30 \
          --fp16 \
          --output_dir=$MODEL_PATH \
          --explanation_policy_pretraining \
          > $MODEL_PATH/train_outputs.log    
    • Testing:
      GPU=0
      MODEL_PATH=explanation_extraction_model
      BEST_MODEL=$(ls $MODEL_PATH/F1* -d | sort -r | head -n 1)
      CUDA_VISIBLE_DEVICES=$GPU python3 test_explanation_policy.py \
          --model_class=explanation_policy_roberta \
          --model_name_or_path=$BEST_MODEL \
          --base_model=roberta-base \
          --explanation_policy_pretraining \
          --data_split=test
Owner
Alon Albalak
Alon Albalak
Minimal implementation of PAWS (https://arxiv.org/abs/2104.13963) in TensorFlow.

PAWS-TF 🐾 Implementation of Semi-Supervised Learning of Visual Features by Non-Parametrically Predicting View Assignments with Support Samples (PAWS)

Sayak Paul 43 Jan 08, 2023
Implementation of the paper "Language-agnostic representation learning of source code from structure and context".

Code Transformer This is an official PyTorch implementation of the CodeTransformer model proposed in: D. Zügner, T. Kirschstein, M. Catasta, J. Leskov

Daniel Zügner 131 Dec 13, 2022
A python script to convert images to animated sus among us crewmate twerk jifs as seen on r/196

img_sussifier A python script to convert images to animated sus among us crewmate twerk jifs as seen on r/196 Examples How to use install python pip i

41 Sep 30, 2022
CurriculumNet: Weakly Supervised Learning from Large-Scale Web Images

CurriculumNet Introduction This repo contains related code and models from the ECCV 2018 CurriculumNet paper. CurriculumNet is a new training strategy

156 Jul 04, 2022
Privacy-Preserving Portrait Matting [ACM MM-21]

Privacy-Preserving Portrait Matting [ACM MM-21] This is the official repository of the paper Privacy-Preserving Portrait Matting. Jizhizi Li∗, Sihan M

Jizhizi_Li 212 Dec 27, 2022
Implementation for Paper "Inverting Generative Adversarial Renderer for Face Reconstruction"

StyleGAR TODO: add arxiv link Implementation of Inverting Generative Adversarial Renderer for Face Reconstruction TODO: for test Currently, some model

155 Oct 27, 2022
Code to use Augmented Shapiro Wilks Stopping, as well as code for the paper "Statistically Signifigant Stopping of Neural Network Training"

This codebase is being actively maintained, please create and issue if you have issues using it Basics All data files are included under losses and ea

J K Terry 32 Nov 09, 2021
Pytorch code for paper "Image Compressed Sensing Using Non-local Neural Network" TMM 2021.

NL-CSNet-Pytorch Pytorch code for paper "Image Compressed Sensing Using Non-local Neural Network" TMM 2021. Note: this repo only shows the strategy of

WenxueCui 7 Nov 07, 2022
SPLADE: Sparse Lexical and Expansion Model for First Stage Ranking

SPLADE 🍴 + 🥄 = 🔎 This repository contains the weights for four models as well as the code for running inference for our two papers: [v1]: SPLADE: S

NAVER 170 Dec 28, 2022
To build a regression model to predict the concrete compressive strength based on the different features in the training data.

Cement-Strength-Prediction Problem Statement To build a regression model to predict the concrete compressive strength based on the different features

Ashish Kumar 4 Jun 11, 2022
Code for ICCV 2021 paper Graph-to-3D: End-to-End Generation and Manipulation of 3D Scenes using Scene Graphs

Graph-to-3D This is the official implementation of the paper Graph-to-3d: End-to-End Generation and Manipulation of 3D Scenes Using Scene Graphs | arx

Helisa Dhamo 33 Jan 06, 2023
scikit-learn: machine learning in Python

scikit-learn is a Python module for machine learning built on top of SciPy and is distributed under the 3-Clause BSD license. The project was started

scikit-learn 52.5k Jan 08, 2023
An implementation of a discriminant function over a normal distribution to help classify datasets.

CS4044D Machine Learning Assignment 1 By Dev Sony, B180297CS The question, report and source code can be found here. Github Repo Solution 1 Based on t

Dev Sony 6 Nov 09, 2021
Tensorboard for pytorch (and chainer, mxnet, numpy, ...)

tensorboardX Write TensorBoard events with simple function call. The current release (v2.3) is tested on anaconda3, with PyTorch 1.8.1 / torchvision 0

Tzu-Wei Huang 7.5k Dec 28, 2022
A PyTorch Implementation of Neural IMage Assessment

NIMA: Neural IMage Assessment This is a PyTorch implementation of the paper NIMA: Neural IMage Assessment (accepted at IEEE Transactions on Image Proc

yunxiaos 418 Dec 29, 2022
Official code for UnICORNN (ICML 2021)

UnICORNN (Undamped Independent Controlled Oscillatory RNN) [ICML 2021] This repository contains the implementation to reproduce the numerical experime

Konstantin Rusch 21 Dec 22, 2022
YOLOX is a high-performance anchor-free YOLO, exceeding yolov3~v5 with ONNX, TensorRT, ncnn, and OpenVINO supported.

Introduction YOLOX is an anchor-free version of YOLO, with a simpler design but better performance! It aims to bridge the gap between research and ind

7.7k Jan 03, 2023
Chatbot in 200 lines of code using TensorLayer

Seq2Seq Chatbot This is a 200 lines implementation of Twitter/Cornell-Movie Chatbot, please read the following references before you read the code: Pr

TensorLayer Community 820 Dec 17, 2022
Implementation of paper "Self-supervised Learning on Graphs:Deep Insights and New Directions"

SelfTask-GNN A PyTorch implementation of "Self-supervised Learning on Graphs: Deep Insights and New Directions". [paper] In this paper, we first deepe

Wei Jin 85 Oct 13, 2022
Mmrotate - OpenMMLab Rotated Object Detection Benchmark

OpenMMLab website HOT OpenMMLab platform TRY IT OUT 📘 Documentation | 🛠️ Insta

OpenMMLab 1.2k Jan 04, 2023