Code Monkey home page Code Monkey logo

sf-id-network-for-nlu's Introduction

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:

  • train.py: The code that is used to train the model containing SF-ID network.
  • train_ID_only.py: The code that is used to train the train only containing SF subnet.
  • train_SF_only.py: The code that is used to train the train only containing ID subnet.
  • utils.py: It contains some functions relevant with data processing and the ev aluation of FI score in slot-filling task.
  • data: It involves the data used in the experiments.
    • atis: This file is about atis dataset, including train/valid/test set.
    • snips: This file is about snips dataset, including train/valid/test set.

Training parameters:

  • dataset: It depends on which dataset is used in the experiment, atis or snips.
  • priority_order: It depends on the execution order of the two subnets, slot-first or i ntent-first.
  • use-crf: It depends on whether CRF layer is used, it is belongs to boolean type. W hen it is set as True, CRF layer is used.
  • iteration number: It depends on the iteration number used in iteration mechanism.

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...
}

sf-id-network-for-nlu's People

Contributors

zephyrchenzf avatar zeionara avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.