ZephyrChenzf / SF-ID-Network-For-NLU

This is the source implementation of ACL2019 accepted paper: A Novel Bi-directional Interrelated Model for Joint Intent Detection and Slot Filling(https://www.aclweb.org/anthology/P19-1544).
Apache License 2.0
103 stars 38 forks source link

SF-ID-Network-For-NLU

License

This is the source implementation of ACL2019 accepted paper: A Novel Bi-directional Interrelated Model for Joint Intent Detection and Slot Filling.

Model Notes

Alt text

Our model๐Ÿš€๐Ÿš€๐Ÿš€

The SF-ID network consists of an SF subnet and an ID subnet. The order of the SF and ID subnets can be customized. Depending on the order of the two subnets, the model have two modes: SF-First and ID-First. The former subnet can produce active effects to the latter one by a medium vector.

Installation

For training, a GPU is strongly recommended for speed. CPU is supported but training could be extremely slow.

Tensorflow

The code is based on Tensorflow and supports Tensorflow-gpu1.11.0 now . You can find installation instructions here.

Dependencies

The code is written in Python 3.5.2. Its dependencies are summarized in the file requirements.txt. You can install these dependencies like this:

pip3 install -r requirements.txt

Data

We mainly focus on the ATIS dataset and Snip dataset, and the code takes its original format as input. You should be able to get it here.

Format

We assume the corpus is formatted as same as the ATIS dataset and Snips dataset. More specifically, seq.in, label and seq.out is our data files.

The input and output of the training data is as follows: The input is a sentence in seq.in in the format:

i want to fly from baltimore to dallas round trip

The output is divided into label output and sequence label output: The output of the label is in the label file in the format:

atis_flight

The output of the sequence label is in seq.out in the format:

O O O O O B-fromloc.city_name O B-toloc.city_name B-round_trip I-round_trip

Following is the structure and description of out files:

Training parameters:

Code reference

SlotGated-SLU

Usage

Here we provide implementations for our models, it is SF-ID-Network. A command example is as follow:

python train.py --dataset=atis --priority_order=slot_first --use_crf=True

Reference

If you use the code, please cite the following paper: "A Novel Bi-directional Interrelated Model for Joint Intent Detection and Slot Filling" Haihong E, Peiqing Niu, Zhongfu Chen, Meina Song. ACL (2019)

@inproceedings{
  under construction...
}