All Projects → yufengm → SelfAttentive

yufengm / SelfAttentive

Licence: other
Implementation of A Structured Self-attentive Sentence Embedding

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to SelfAttentive

visualization
a collection of visualization function
Stars: ✭ 189 (+76.64%)
Mutual labels:  attention-mechanism
NTUA-slp-nlp
💻Speech and Natural Language Processing (SLP & NLP) Lab Assignments for ECE NTUA
Stars: ✭ 19 (-82.24%)
Mutual labels:  attention-mechanism
Video-Cap
🎬 Video Captioning: ICCV '15 paper implementation
Stars: ✭ 44 (-58.88%)
Mutual labels:  attention-mechanism
DAF3D
Deep Attentive Features for Prostate Segmentation in 3D Transrectal Ultrasound
Stars: ✭ 60 (-43.93%)
Mutual labels:  attention-mechanism
keras-deep-learning
Various implementations and projects on CNN, RNN, LSTM, GAN, etc
Stars: ✭ 22 (-79.44%)
Mutual labels:  attention-mechanism
enformer-pytorch
Implementation of Enformer, Deepmind's attention network for predicting gene expression, in Pytorch
Stars: ✭ 146 (+36.45%)
Mutual labels:  attention-mechanism
SANET
Arbitrary Style Transfer with Style-Attentional Networks
Stars: ✭ 105 (-1.87%)
Mutual labels:  attention-mechanism
nuwa-pytorch
Implementation of NÜWA, state of the art attention network for text to video synthesis, in Pytorch
Stars: ✭ 347 (+224.3%)
Mutual labels:  attention-mechanism
Patient2Vec
Patient2Vec: A Personalized Interpretable Deep Representation of the Longitudinal Electronic Health Record
Stars: ✭ 85 (-20.56%)
Mutual labels:  attention-mechanism
attention-mechanism-keras
attention mechanism in keras, like Dense and RNN...
Stars: ✭ 19 (-82.24%)
Mutual labels:  attention-mechanism
automatic-personality-prediction
[AAAI 2020] Modeling Personality with Attentive Networks and Contextual Embeddings
Stars: ✭ 43 (-59.81%)
Mutual labels:  attention-mechanism
AoA-pytorch
A Pytorch implementation of Attention on Attention module (both self and guided variants), for Visual Question Answering
Stars: ✭ 33 (-69.16%)
Mutual labels:  attention-mechanism
FragmentVC
Any-to-any voice conversion by end-to-end extracting and fusing fine-grained voice fragments with attention
Stars: ✭ 134 (+25.23%)
Mutual labels:  attention-mechanism
OverlapPredator
[CVPR 2021, Oral] PREDATOR: Registration of 3D Point Clouds with Low Overlap.
Stars: ✭ 293 (+173.83%)
Mutual labels:  attention-mechanism
PAM
[TPAMI 2020] Parallax Attention for Unsupervised Stereo Correspondence Learning
Stars: ✭ 62 (-42.06%)
Mutual labels:  attention-mechanism
dcsp segmentation
No description or website provided.
Stars: ✭ 34 (-68.22%)
Mutual labels:  attention-mechanism
nystrom-attention
Implementation of Nyström Self-attention, from the paper Nyströmformer
Stars: ✭ 83 (-22.43%)
Mutual labels:  attention-mechanism
Image-Caption
Using LSTM or Transformer to solve Image Captioning in Pytorch
Stars: ✭ 36 (-66.36%)
Mutual labels:  attention-mechanism
QuantumForest
Fast Differentiable Forest lib with the advantages of both decision trees and neural networks
Stars: ✭ 63 (-41.12%)
Mutual labels:  attention-mechanism
SentimentAnalysis
Sentiment Analysis: Deep Bi-LSTM+attention model
Stars: ✭ 32 (-70.09%)
Mutual labels:  attention-mechanism

Self-Attentive Model in PyTorch

Implementation of A Structured Self-attentive Sentence Embedding [Paper] [Review]

To run the model, GloVe word vectors need to be downloaded and placed in 'word2vecs'. By default, we use 200d vectors trained on Wikipedia corpus.

mkdir word2vecs

'Data Preprocessing.ipynb' helps preprocess raw reviews into format compatible with data in 'data' folder.

Training, validation and test data ending with '.csv' file is put in 'data' folder. The first column is review token sequence, while the second column corresponds to 2 classes (helpful or not). The last column is the token length and the review is sorted in descending order.

'data/embed_matrix.pt' is the word embedding matrix initialized with GloVe vectors and words do not show up in GloVe is initialed from Uniform distribution. The corresponding index in stored in 'data/word_idx_list.pt'. This can help only update word embeddings that do not appear in GloVe.

To start training, run

python train.py

After training, we can get the attention weights of test data by

python attentive_weights.py

Then we can turn to 'Attention Visualization.ipynb' to highlight word tokens in reviews.

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