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
Applying CLIP to Point Cloud Recognition.

PointCLIP: Point Cloud Understanding by CLIP This repository is an official implementation of the paper 'PointCLIP: Point Cloud Understanding by CLIP'

Renrui Zhang 175 Dec 24, 2022
PyTorch implementation of ARM-Net: Adaptive Relation Modeling Network for Structured Data.

A ready-to-use framework of latest models for structured (tabular) data learning with PyTorch. Applications include recommendation, CRT prediction, healthcare analytics, and etc.

48 Nov 30, 2022
An adaptive hierarchical energy management strategy for hybrid electric vehicles

An adaptive hierarchical energy management strategy This project contains the source code of an adaptive hierarchical EMS combining heuristic equivale

19 Dec 13, 2022
Source code release of the paper: Knowledge-Guided Deep Fractal Neural Networks for Human Pose Estimation.

GNet-pose Project Page: http://guanghan.info/projects/guided-fractal/ UPDATE 9/27/2018: Prototxts and model that achieved 93.9Pck on LSP dataset. http

Guanghan Ning 83 Nov 21, 2022
2D&3D human pose estimation

Human Pose Estimation Papers [CVPR 2016] - 201511 [IJCAI 2016] - 201602 Other Action Recognition with Joints-Pooled 3D Deep Convolutional Descriptors

133 Jan 02, 2023
Code basis for the paper "Camera Condition Monitoring and Readjustment by means of Noise and Blur" (2021)

Camera Condition Monitoring and Readjustment by means of Noise and Blur This repository contains the source code of the paper: Wischow, M., Gallego, G

7 Dec 22, 2022
An open source app to help calm you down when needed.

By: Seanpm2001, Et; Al. Top README.md Read this article in a different language Sorted by: A-Z Sorting options unavailable ( af Afrikaans Afrikaans |

Sean P. Myrick V19.1.7.2 2 Oct 24, 2022
SpeechNAS Better Trade off between Latency and Accuracy for Large Scale Speaker Verification

SpeechNAS Better Trade off between Latency and Accuracy for Large Scale Speaker Verification

Wentao Zhu 24 May 20, 2022
Code for TIP 2017 paper --- Illumination Decomposition for Photograph with Multiple Light Sources.

Illumination_Decomposition Code for TIP 2017 paper --- Illumination Decomposition for Photograph with Multiple Light Sources. This code implements the

QAY 7 Nov 15, 2020
Universal Probability Distributions with Optimal Transport and Convex Optimization

Sylvester normalizing flows for variational inference Pytorch implementation of Sylvester normalizing flows, based on our paper: Sylvester normalizing

Rianne van den Berg 172 Dec 13, 2022
PyTorch version of the paper 'Enhanced Deep Residual Networks for Single Image Super-Resolution' (CVPRW 2017)

About PyTorch 1.2.0 Now the master branch supports PyTorch 1.2.0 by default. Due to the serious version problem (especially torch.utils.data.dataloade

Sanghyun Son 2.1k Jan 01, 2023
Labels4Free: Unsupervised Segmentation using StyleGAN

Labels4Free: Unsupervised Segmentation using StyleGAN ICCV 2021 Figure: Some segmentation masks predicted by Labels4Free Framework on real and synthet

70 Dec 23, 2022
Semi-Supervised Signed Clustering Graph Neural Network (and Implementation of Some Spectral Methods)

SSSNET SSSNET: Semi-Supervised Signed Network Clustering For details, please read our paper. Environment Setup Overview The project has been tested on

Yixuan He 9 Nov 24, 2022
Shuwa Gesture Toolkit is a framework that detects and classifies arbitrary gestures in short videos

Shuwa Gesture Toolkit is a framework that detects and classifies arbitrary gestures in short videos

Google 89 Dec 22, 2022
Code for the paper "Reinforcement Learning as One Big Sequence Modeling Problem"

Trajectory Transformer Code release for Reinforcement Learning as One Big Sequence Modeling Problem. Installation All python dependencies are in envir

Michael Janner 269 Jan 05, 2023
A python library for self-supervised learning on images.

Lightly is a computer vision framework for self-supervised learning. We, at Lightly, are passionate engineers who want to make deep learning more effi

Lightly 2k Jan 08, 2023
Continuum Learning with GEM: Gradient Episodic Memory

Gradient Episodic Memory for Continual Learning Source code for the paper: @inproceedings{GradientEpisodicMemory, title={Gradient Episodic Memory

Facebook Research 360 Dec 27, 2022
Pytorch implementation for "Implicit Feature Alignment: Learn to Convert Text Recognizer to Text Spotter".

Implicit Feature Alignment: Learn to Convert Text Recognizer to Text Spotter This is a pytorch-based implementation for paper Implicit Feature Alignme

wangtianwei 61 Nov 12, 2022
Conformer: Local Features Coupling Global Representations for Visual Recognition

Conformer: Local Features Coupling Global Representations for Visual Recognition (arxiv) This repository is built upon DeiT and timm Usage First, inst

Zhiliang Peng 378 Jan 08, 2023
Language Models for the legal domain in Spanish done @ BSC-TEMU within the "Plan de las Tecnologías del Lenguaje" (Plan-TL).

Spanish legal domain Language Model ⚖️ This repository contains the page for two main resources for the Spanish legal domain: A RoBERTa model: https:/

Plan de Tecnologías del Lenguaje - Gobierno de España 12 Nov 14, 2022