All Projects → lc222 → Attention Over Attention Tf Qa

lc222 / Attention Over Attention Tf Qa

论文“Attention-over-Attention Neural Networks for Reading Comprehension”中AoA模型实现

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Attention Over Attention Tf Qa

Rnn For Joint Nlu
Pytorch implementation of "Attention-Based Recurrent Neural Network Models for Joint Intent Detection and Slot Filling" (https://arxiv.org/abs/1609.01454)
Stars: ✭ 176 (+203.45%)
Mutual labels:  rnn, attention
EBIM-NLI
Enhanced BiLSTM Inference Model for Natural Language Inference
Stars: ✭ 24 (-58.62%)
Mutual labels:  rnn, attention
Doc Han Att
Hierarchical Attention Networks for Chinese Sentiment Classification
Stars: ✭ 206 (+255.17%)
Mutual labels:  rnn, attention
Captcharecognition
End-to-end variable length Captcha recognition using CNN+RNN+Attention/CTC (pytorch implementation). 端到端的不定长验证码识别
Stars: ✭ 97 (+67.24%)
Mutual labels:  rnn, attention
Time Attention
Implementation of RNN for Time Series prediction from the paper https://arxiv.org/abs/1704.02971
Stars: ✭ 52 (-10.34%)
Mutual labels:  rnn, attention
Chinese Chatbot
中文聊天机器人,基于10万组对白训练而成,采用注意力机制,对一般问题都会生成一个有意义的答复。已上传模型,可直接运行,跑不起来直播吃键盘。
Stars: ✭ 124 (+113.79%)
Mutual labels:  rnn, attention
keras-utility-layer-collection
Collection of custom layers and utility functions for Keras which are missing in the main framework.
Stars: ✭ 63 (+8.62%)
Mutual labels:  rnn, attention
Jddc solution 4th
2018-JDDC大赛第4名的解决方案
Stars: ✭ 235 (+305.17%)
Mutual labels:  attention, qa
R Net
A Tensorflow Implementation of R-net: Machine reading comprehension with self matching networks
Stars: ✭ 321 (+453.45%)
Mutual labels:  rnn, qa
Base-On-Relation-Method-Extract-News-DA-RNN-Model-For-Stock-Prediction--Pytorch
基於關聯式新聞提取方法之雙階段注意力機制模型用於股票預測
Stars: ✭ 33 (-43.1%)
Mutual labels:  rnn, attention
Cnn lstm for text classify
CNN, LSTM, NBOW, fasttext 中文文本分类
Stars: ✭ 90 (+55.17%)
Mutual labels:  rnn, attention
Nlp tensorflow project
Use tensorflow to achieve some NLP project, eg: classification chatbot ner attention QAetc.
Stars: ✭ 27 (-53.45%)
Mutual labels:  attention, qa
Attend infer repeat
A Tensorfflow implementation of Attend, Infer, Repeat
Stars: ✭ 82 (+41.38%)
Mutual labels:  rnn, attention
Qrn
Query-Reduction Networks (QRN)
Stars: ✭ 137 (+136.21%)
Mutual labels:  rnn, qa
Machine Learning
My Attempt(s) In The World Of ML/DL....
Stars: ✭ 78 (+34.48%)
Mutual labels:  rnn, attention
Pytorch Seq2seq
Tutorials on implementing a few sequence-to-sequence (seq2seq) models with PyTorch and TorchText.
Stars: ✭ 3,418 (+5793.1%)
Mutual labels:  rnn, attention
Bertqa Attention On Steroids
BertQA - Attention on Steroids
Stars: ✭ 112 (+93.1%)
Mutual labels:  attention, qa
automatic-personality-prediction
[AAAI 2020] Modeling Personality with Attentive Networks and Contextual Embeddings
Stars: ✭ 43 (-25.86%)
Mutual labels:  rnn, attention
Tf Rnn Attention
Tensorflow implementation of attention mechanism for text classification tasks.
Stars: ✭ 735 (+1167.24%)
Mutual labels:  rnn, attention
Attentive Neural Processes
implementing "recurrent attentive neural processes" to forecast power usage (w. LSTM baseline, MCDropout)
Stars: ✭ 33 (-43.1%)
Mutual labels:  rnn, attention

Attention over Attention

这是我仿照github上面一个用户的代码,仅对其中少量部分代码进行了修改,是代码支持tf1.0及以上版本
源代码链接为:https://github.com/OlavHN/attention-over-attention
代码执行顺序为:
1,下载数据集
2,运行reader.py文件,将原数据集保存为.tfrecords文件,方便程序的高效读取
3,运行model.py文件,训练模型.

以下是原链接的readme说明。
Implementation of the paper Attention-over-Attention Neural Networks for Reading Comprehension in tensorflow

Some context on my blog

Reading comprehension for cloze style tasks is to remove word from an article summary, then read the article and try to infer the missing word. This example works on the CNN news dataset.

With the same hyperparameters as reported in the paper, this implementation got an accuracy of 74.3% on both the validation and test set, compared with 73.1% and 74.4% reported by the author.

To train a new model: python model.py --training=True --name=my_model

To test accuracy: python model.py --training=False --name=my_model --epochs=1 --dropout_keep_prob=1

Note that the tfrecords and model files are stored with git lfs

Raw data for use with reader.py to produce .tfrecords files was downloaded from [http://cs.nyu.edu/~kcho/DMQA/]

Interesting parts

  • Masked softmax implementation
  • Example of batched sparse tensors with correct mask handling
  • Example of pointer style attention
  • Test/validation split part of the tf-graph
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].