This code is a combination of word2vec and self attention layer.
Self attention layer:(pip install keras-self-attention) https://github.com/CyberZHG/keras-self-attention
https://arxiv.org/pdf/1601.06733.pdf
https://qiita.com/norihitoishida/items/2fead107792b504eaccf
https://github.com/CyberZHG/keras-self-attention
https://www.inoue-kobo.com/ai_ml/text-classification-by-selfattention/index.html