Code for "Graph-Evolving Meta-Learning for Low-Resource Medical Dialogue Generation". [AAAI 2021]

Overview

Graph Evolving Meta-Learning for Low-resource Medical Dialogue Generation

Code to be further cleaned...

This repo contains the code of the following paper:

Graph Evolving Meta-Learning for Low-resource Medical Dialogue Generation

Shuai Lin, Pan Zhou, Xiaodan Liang, Jianheng Tang, Ruihui Zhao, Ziliang Chen, Liang Lin.
AAAI 2021

Prerequisites

  1. Allennlp (0.9.1-unreleased)

  2. pytorch == 1.4.0

  3. Others should be found in ./allennlp/requirements.txt

[Note]: You need to install allennlp with the editable mode, i.e.,

cd ./allennlp
pip install --editable .
cd ..

since we have modified this toolkit (including added the metatrainer.py in the directory ./allennlp/training and so on).

Datasets

Please download both datasets from the google drive as follows:

wget https://drive.google.com/file/d/1KZ0CrIVZhSLxlZ-V5pnksvgH1xlyd54F/view?usp=sharing
tar zxvf cy.tar.gz
wget https://drive.google.com/file/d/1sZzb3Nzm_Z37lNCfgusJscFuiyhUON5j/view?usp=sharing
tar zxvf fd.tar.gz
  1. CMDD: The directory fd/dis_pk_dir, which includes raw_data, meta_train and meta_test. (The number of the file name represents the ID of a disease.) You can also obtain it at the link

  2. MDG-Chunyu: The directory cy/dis_pk_dir, which also includes the raw_data, meta_train and meta_test. The ID of diseases and symptoms are recorded in the user_dict.txt. The disease IDs are as follows:

{
  '胃炎': 2,
  '普通感冒': 13,
  '肺炎': 73,
  '便秘': 6,
  '胃肠功能紊乱': 42,
  '肠炎': 9,
  '肠易激综合征': 40,
  '食管炎': 27,
  '胃溃疡': 30,
  '阑尾炎': 35,
  '胆囊炎': 33,
  '胰腺炎': 48,
  '肠梗阻': 52,
  '痔疮': 18,
  '肝硬化': 46,
}

Quick Start

Most of the running commands are written in the script run.sh, which follows the offical train/fine-tune/evaluate way of the allennlp. Take the following one as an example:

[1]. Training:

CUDA_VISIBLE_DEVICES=1 allennlp train -s $save_directory$ \
  $config_file(.json)$ \
  --include-package $model_file$

[2]. Fine-tuning:

CUDA_VISIBLE_DEVICES=1 allennlp fine-tune -m $old save_directory$ \
  -c $config_file(.json)$ \
  --include-package $model_file$
  -s $new save_directory$

[3]. Testing:

CUDA_VISIBLE_DEVICES=3 allennlp evaluate  $new save_directory$ \
  $test_data$ \
  --include-package $model_file$ \
  --output-file $output_directory$
You might also like...
 MVFNet: Multi-View Fusion Network for Efficient Video Recognition (AAAI 2021)
MVFNet: Multi-View Fusion Network for Efficient Video Recognition (AAAI 2021)

MVFNet: Multi-View Fusion Network for Efficient Video Recognition (AAAI 2021) Overview We release the code of the MVFNet (Multi-View Fusion Network).

[AAAI-2021] Visual Boundary Knowledge Translation for Foreground Segmentation
[AAAI-2021] Visual Boundary Knowledge Translation for Foreground Segmentation

Trans-Net Code for (Visual Boundary Knowledge Translation for Foreground Segmentation, AAAI2021). [https://ojs.aaai.org/index.php/AAAI/article/view/16

SnapMix: Semantically Proportional Mixing for Augmenting Fine-grained Data (AAAI 2021)
SnapMix: Semantically Proportional Mixing for Augmenting Fine-grained Data (AAAI 2021)

SnapMix: Semantically Proportional Mixing for Augmenting Fine-grained Data (AAAI 2021) PyTorch implementation of SnapMix | paper Method Overview Cite

Official implementation for paper Knowledge Bridging for Empathetic Dialogue Generation (AAAI 2021).
Official implementation for paper Knowledge Bridging for Empathetic Dialogue Generation (AAAI 2021).

Knowledge Bridging for Empathetic Dialogue Generation This is the official implementation for paper Knowledge Bridging for Empathetic Dialogue Generat

Code for the AAAI 2022 paper "Zero-Shot Cross-Lingual Machine Reading Comprehension via Inter-Sentence Dependency Graph".

multilingual-mrc-isdg Code for the AAAI 2022 paper "Zero-Shot Cross-Lingual Machine Reading Comprehension via Inter-Sentence Dependency Graph". This r

Code for the AAAI-2022 paper: Imagine by Reasoning: A Reasoning-Based Implicit Semantic Data Augmentation for Long-Tailed Classification

Imagine by Reasoning: A Reasoning-Based Implicit Semantic Data Augmentation for Long-Tailed Classification (AAAI 2022) Prerequisite PyTorch = 1.2.0 P

An official source code for paper Deep Graph Clustering via Dual Correlation Reduction, accepted by AAAI 2022
An official source code for paper Deep Graph Clustering via Dual Correlation Reduction, accepted by AAAI 2022

Dual Correlation Reduction Network An official source code for paper Deep Graph Clustering via Dual Correlation Reduction, accepted by AAAI 2022. Any

Code for One-shot Talking Face Generation from Single-speaker Audio-Visual Correlation Learning (AAAI 2022)

One-shot Talking Face Generation from Single-speaker Audio-Visual Correlation Learning (AAAI 2022) Paper | Demo Requirements Python = 3.6 , Pytorch

Parallel and High-Fidelity Text-to-Lip Generation; AAAI 2022 ; Official code

Parallel and High-Fidelity Text-to-Lip Generation This repository is the official PyTorch implementation of our AAAI-2022 paper, in which we propose P

Comments
  • fail to replicate the experiment

    fail to replicate the experiment

    Hello!

    I have some questions about the code.

    1. can I use "our_geml_cy.py" to pretrain the model and "our_geml_eval_cy.py" to get the test result?
    2. in "our_geml_cy.py", line 284, the code "symp_state[i][self.topic + j] = utter_hidden[i][j]" seems to be useless?
    3. in "our_geml_cy.py", line 286, is it wrong to assign the value? "sym_mat[i][j][j:last] = torch.ones(1)" is to connect the neighbor two utterances, right? so it should be "sym_mat[i][self.topic+j][self.topic+j:self.topic+last] = torch.ones(1)".
    4. i follow the "our_geml_cy.py" and "our_geml_eval_cy.py" and train the model with the dataset "cy" in 30 epochs, however, the predictions are all "这种情况多久了?"
    opened by KaishuaiXu 3
  • CVE-2007-4559 Patch

    CVE-2007-4559 Patch

    Patching CVE-2007-4559

    Hi, we are security researchers from the Advanced Research Center at Trellix. We have began a campaign to patch a widespread bug named CVE-2007-4559. CVE-2007-4559 is a 15 year old bug in the Python tarfile package. By using extract() or extractall() on a tarfile object without sanitizing input, a maliciously crafted .tar file could perform a directory path traversal attack. We found at least one unsantized extractall() in your codebase and are providing a patch for you via pull request. The patch essentially checks to see if all tarfile members will be extracted safely and throws an exception otherwise. We encourage you to use this patch or your own solution to secure against CVE-2007-4559. Further technical information about the vulnerability can be found in this blog.

    If you have further questions you may contact us through this projects lead researcher Kasimir Schulz.

    opened by TrellixVulnTeam 0
Owner
Shuai Lin
Master student @sysu, mainly focus on ML/NLP.
Shuai Lin
Source code for paper "Document-Level Relation Extraction with Adaptive Thresholding and Localized Context Pooling", AAAI 2021

ATLOP Code for AAAI 2021 paper Document-Level Relation Extraction with Adaptive Thresholding and Localized Context Pooling. If you make use of this co

Wenxuan Zhou 146 Nov 29, 2022
git《Self-Attention Attribution: Interpreting Information Interactions Inside Transformer》(AAAI 2021) GitHub:

Self-Attention Attribution This repository contains the implementation for AAAI-2021 paper Self-Attention Attribution: Interpreting Information Intera

null 60 Dec 29, 2022
[AAAI 2021] MVFNet: Multi-View Fusion Network for Efficient Video Recognition

MVFNet: Multi-View Fusion Network for Efficient Video Recognition (AAAI 2021) Overview We release the code of the MVFNet (Multi-View Fusion Network).

Wenhao Wu 114 Nov 27, 2022
《LightXML: Transformer with dynamic negative sampling for High-Performance Extreme Multi-label Text Classification》(AAAI 2021) GitHub:

LightXML: Transformer with dynamic negative sampling for High-Performance Extreme Multi-label Text Classification

null 76 Dec 5, 2022
:hot_pepper: R²SQL: "Dynamic Hybrid Relation Network for Cross-Domain Context-Dependent Semantic Parsing." (AAAI 2021)

R²SQL The PyTorch implementation of paper Dynamic Hybrid Relation Network for Cross-Domain Context-Dependent Semantic Parsing. (AAAI 2021) Requirement

huybery 60 Dec 31, 2022
Official implementation for (Show, Attend and Distill: Knowledge Distillation via Attention-based Feature Matching, AAAI-2021)

Show, Attend and Distill: Knowledge Distillation via Attention-based Feature Matching Official pytorch implementation of "Show, Attend and Distill: Kn

Clova AI Research 80 Dec 16, 2022
(AAAI 2021) Progressive One-shot Human Parsing

End-to-end One-shot Human Parsing This is the official repository for our two papers: Progressive One-shot Human Parsing (AAAI 2021) End-to-end One-sh

null 54 Dec 30, 2022
Official PyTorch implementation of "Proxy Synthesis: Learning with Synthetic Classes for Deep Metric Learning" (AAAI 2021)

Proxy Synthesis: Learning with Synthetic Classes for Deep Metric Learning Official PyTorch implementation of "Proxy Synthesis: Learning with Synthetic

NAVER/LINE Vision 30 Dec 6, 2022
Implementation of accepted AAAI 2021 paper: Deep Unsupervised Image Hashing by Maximizing Bit Entropy

Deep Unsupervised Image Hashing by Maximizing Bit Entropy This is the PyTorch implementation of accepted AAAI 2021 paper: Deep Unsupervised Image Hash

null 62 Dec 30, 2022
Co-mining: Self-Supervised Learning for Sparsely Annotated Object Detection, AAAI 2021.

Co-mining: Self-Supervised Learning for Sparsely Annotated Object Detection This repository is an official implementation of the AAAI 2021 paper Co-mi

MEGVII Research 20 Dec 7, 2022