Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Self Attentive Sentence Encoder #2272

Closed
wants to merge 8 commits into from

Conversation

rangwani-harsh
Copy link
Contributor

@rangwani-harsh rangwani-harsh commented Jan 4, 2019

This PR contains the implementation of the Self-Attentive-Sentence-Encoder described here #2188

TODO

  • Implement the Encoder
  • Add unit tests
  • Implement a Seq2Vec Wrapper ( Need some discussion before implementation) ( A basic version implemented)

* Fix tests
* Fix typing
Copy link
Contributor

@joelgrus joelgrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this, I have several comments

allennlp/modules/self_attentive_sentence_encoder.py Outdated Show resolved Hide resolved
allennlp/modules/self_attentive_sentence_encoder.py Outdated Show resolved Hide resolved
allennlp/modules/self_attentive_sentence_encoder.py Outdated Show resolved Hide resolved
allennlp/modules/self_attentive_sentence_encoder.py Outdated Show resolved Hide resolved
allennlp/modules/self_attentive_sentence_encoder.py Outdated Show resolved Hide resolved
allennlp/modules/self_attentive_sentence_encoder.py Outdated Show resolved Hide resolved
@rangwani-harsh
Copy link
Contributor Author

rangwani-harsh commented Jan 19, 2019

This is good for another look. @joelgrus

@jianwolf
Copy link

Hi! It's been 4 months and self attention is a very useful model. Could someone please review the model code?

@jianwolf
Copy link

jianwolf commented Jun 3, 2019

@rangwani-harsh You didn't implement the bi-directional LSTM before the self attention layer?

@rangwani-harsh
Copy link
Contributor Author

@jianwolf You can use the Attention module using any Seq2Seq encoder. As Bidirectional LSTM is a Seq2Seq encoder you can just specify it in your model and pass the output of the Bidirectional LSTM to the Structed Self Attentive Encoder. For example you can see here https://github.com/rangwani-harsh/sentence-encoder-irony-detection/blob/71b5adf9d755e53918797fb0bfabe6acd6ffcaec/irony_model/model/model.py#L82 .

@matt-gardner
Copy link
Contributor

@joelgrus, you want to follow up on this one?

@DeNeutoy
Copy link
Contributor

We closed the issue associated with this as we're not sure that it's necessary for it to be integrated into the library itself - feel free to push it to it's own github repo.

@DeNeutoy DeNeutoy closed this Jun 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants