项目作者: applenob

项目描述 :
Tensorflow implementation of "Attention-Based Recurrent Neural Network Models for Joint Intent Detection and Slot Filling" (https://arxiv.org/abs/1609.01454)
高级语言: Jupyter Notebook
项目地址: git://github.com/applenob/RNN-for-Joint-NLU.git
创建时间: 2017-10-19T02:53:53Z
项目社区:https://github.com/applenob/RNN-for-Joint-NLU

开源协议:

下载


RNN-for-Joint-NLU

模型介绍

使用tensorflow r1.3 api,Encoder使用tf.nn.bidirectional_dynamic_rnn实现,Decoder使用tf.contrib.seq2seq.CustomHelpertf.contrib.seq2seq.dynamic_decode实现。

原作者Bing Liu的Tensorflow实现

我的实现相对比较简单,用于学习目的。

使用

  1. python main.py

输出:

  1. [Epoch 27] Average train loss: 0.0
  2. Input Sentence : ['what', 'are', 'the', 'flights', 'and', 'prices', 'from', 'la', 'to', 'charlotte', 'for', 'monday', 'morning']
  3. Slot Truth : ['O', 'O', 'O', 'O', 'O', 'O', 'O', 'B-fromloc.city_name', 'O', 'B-toloc.city_name', 'O', 'B-depart_date.day_name', 'B-depart_time.period_of_day']
  4. Slot Prediction : ['O', 'O', 'O', 'O', 'O', 'O', 'O', 'B-fromloc.city_name', 'O', 'B-toloc.city_name', 'O', 'B-depart_date.day_name', 'B-depart_time.period_of_day']
  5. Intent Truth : atis_flight
  6. Intent Prediction : atis_flight#atis_airfare
  7. Intent accuracy for epoch 27: 0.969758064516129
  8. Slot accuracy for epoch 27: 0.9782146713160718
  9. Slot F1 score for epoch 27: 0.977950943062074
  10. [Epoch 28] Average train loss: 0.0
  11. Input Sentence : ['show', 'me', 'the', 'last', 'flight', 'from', 'love', 'field']
  12. Slot Truth : ['O', 'O', 'O', 'B-flight_mod', 'O', 'O', 'B-fromloc.airport_name', 'I-fromloc.airport_name']
  13. Slot Prediction : ['O', 'O', 'O', 'B-flight_mod', 'O', 'O', 'B-fromloc.airport_name', 'I-fromloc.airport_name']
  14. Intent Truth : atis_flight
  15. Intent Prediction : atis_flight
  16. Intent accuracy for epoch 28: 0.9717741935483871
  17. Slot accuracy for epoch 28: 0.9794670271393975
  18. Slot F1 score for epoch 28: 0.9792847025495751

细节

博客文章: