Giter Site home page Giter Site logo

dsksd / rnn-for-joint-nlu Goto Github PK

View Code? Open in Web Editor NEW
197.0 10.0 51.0 181 KB

Pytorch implementation of "Attention-Based Recurrent Neural Network Models for Joint Intent Detection and Slot Filling" (https://arxiv.org/abs/1609.01454)

Jupyter Notebook 60.13% Python 39.87%
intent slot-filling task-oriented-dialogue nlu rnn lstm attention encoder-decoder

rnn-for-joint-nlu's Introduction

RNN-for-Joint-NLU

Pytorch implementation of "Attention-Based Recurrent Neural Network Models for Joint Intent Detection and Slot Filling" (https://arxiv.org/pdf/1609.01454.pdf)

Intent prediction and slot filling are performed in two branches based on Encoder-Decoder model.

dataset (Atis)

You can get data from here

Requirements

  • Pytorch 0.2

Train

python3 train.py --data_path 'your data path e.g. ./data/atis-2.train.w-intent.iob'

Result

rnn-for-joint-nlu's People

Contributors

dsksd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rnn-for-joint-nlu's Issues

Could not set num_layers > 1 for LSTM

since in the code we suppose the hidden layer's shape is [1, B, D], if we set num_layers > 1 for LSTM whose hidden layer's shape will be [>1, B, D] so that some continued operation could not be executed successfully.

code question in train.py

Hi,thank you for implementing the code for that paper. But I encountered a problem while

 tag_score, intent_score = decoder(start_decode,hidden_c,output,x_mask)

> Traceback (most recent call last):
  File "E:/NER/RNN-for-Joint-NLU-master/train.py", line 102, in <module>
    train(config)
  File "E:/NER/RNN-for-Joint-NLU-master/train.py", line 54, in train
    tag_score, intent_score = decoder(start_decode,hidden_c,output,x_mask)
  File "D:\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "E:\NER\RNN-for-Joint-NLU-master\model.py", line 120, in forward
    _, hidden = self.lstm(torch.cat((embedded,context,aligned),2), hidden) # input, context, aligned encoder hidden, hidden
  File "D:\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "D:\anaconda3\lib\site-packages\torch\nn\modules\rnn.py", line 175, in forward
    self.check_forward_args(input, hx, batch_sizes)
  File "D:\anaconda3\lib\site-packages\torch\nn\modules\rnn.py", line 152, in check_forward_args
    'Expected hidden[0] size {}, got {}')
  File "D:\anaconda3\lib\site-packages\torch\nn\modules\rnn.py", line 148, in check_hidden_size
    raise RuntimeError(msg.format(expected_hidden_size, tuple(hx.size())))
RuntimeError: Expected hidden[0] size (1, 16, 128), got (2, 16, 128)

clone

hi, in the class Decoder, i want to know when u compute the intent hidden, why use copy()? why not directly use the hidden[0]?

Intent score

Thank you for open sourcing your code. I couldn't reach the intent perfomance mentioned in the paper. Can you tell what is a performance that you getting?

Thanks in advance.

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.