Giter VIP home page Giter VIP logo

rnn-for-joint-nlu's Introduction

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实现

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

使用

python main.py

输出:

[Epoch 27] Average train loss: 0.0
Input Sentence        :  ['what', 'are', 'the', 'flights', 'and', 'prices', 'from', 'la', 'to', 'charlotte', 'for', 'monday', 'morning']
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']
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']
Intent Truth          :  atis_flight
Intent Prediction     :  atis_flight#atis_airfare
Intent accuracy for epoch 27: 0.969758064516129
Slot accuracy for epoch 27: 0.9782146713160718
Slot F1 score for epoch 27: 0.977950943062074
[Epoch 28] Average train loss: 0.0
Input Sentence        :  ['show', 'me', 'the', 'last', 'flight', 'from', 'love', 'field']
Slot Truth            :  ['O', 'O', 'O', 'B-flight_mod', 'O', 'O', 'B-fromloc.airport_name', 'I-fromloc.airport_name']
Slot Prediction       :  ['O', 'O', 'O', 'B-flight_mod', 'O', 'O', 'B-fromloc.airport_name', 'I-fromloc.airport_name']
Intent Truth          :  atis_flight
Intent Prediction     :  atis_flight
Intent accuracy for epoch 28: 0.9717741935483871
Slot accuracy for epoch 28: 0.9794670271393975
Slot F1 score for epoch 28: 0.9792847025495751

细节

博客文章:

rnn-for-joint-nlu's People

Contributors

applenob avatar martinomensio avatar

Watchers

 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.