Code Monkey home page Code Monkey logo

shunchi100 / ssan-self-attention-sentiment-analysis-classification Goto Github PK

View Code? Open in Web Editor NEW

This project forked from artaches/ssan-self-attention-sentiment-analysis-classification

0.0 2.0 0.0 57.28 MB

Self-Attention: A Better Building Block for Sentiment Analysis Neural Network Classifiers - paper's code for the 9th Workshop on Computational Approaches to Subjectivity, Sentiment & Social Media Analysis - help in conjuction with EMNLP 2018

License: Apache License 2.0

Python 98.29% Shell 1.71%

ssan-self-attention-sentiment-analysis-classification's Introduction

SSAN-self-attention-sentiment-analysis-classification

Code for the paper "Self-Attention: A Better Building Block for Sentiment Analysis Neural Network Classifiers": http://aclweb.org/anthology/W18-6219 . This paper was published in WASSA 2018 (9th Workshop on Computational Approaches to Subjectivity, Sentiment & Social Media Analysis), held in conjuction with EMNLP 2018.

Contact: [email protected]

The paper builds upon the work of the paper "Assessing State-of-the-art Sentiment Models on State-of-the-art Sentiment Datasets", Barnes et. al. This repository is a fork of their implementation for the said paper: https://github.com/jbarnesspain/sota_sentiment.

Abstract

Sentiment Analysis has seen much progress in the past two decades. For the past few years, neural network approaches, primarily RNNs and CNNs, have been the most successful for this task. Recently, a new category of neural networks, self-attention networks (SANs), have been created which utilizes the attention mechanism as the basic building block. Self-attention networks have been shown to be effective for sequence modeling tasks, while having no recurrence or convolutions. In this work we explore the effectiveness of the SANs for sentiment analysis. We demonstrate that SANs are superior in performance to their RNN and CNN counterparts by comparing their classification accuracy on six datasets as well as their model characteristics such as training speed and memory consumption. Finally, we explore the effects of various SAN modifications such as multi-head attention as well as two methods of incorporating sequence position information into SANs.

Run Self-Attention models

To run the work we've done, simply unzip the google word embeddings in the /embeddings folder (or use your own) and run python san.py -emb embeddings/google.txt. To change which self-attention architecture that was discussed in the paper you'd like to, see the hparams dictionary object in san.py. Using the values in that dictionary you can configure the san.py script to run SSAN, Transfore Encoder, RPR or PE positional information technques, etc. To run the baseline models, follow the instructions from: https://github.com/jbarnesspain/sota_sentiment

Word Embeddings

Other word embeddings from Barnes et. al can be found: (available here)

Datasets

  1. Stanford Sentiment Treebank - fine-grained
  2. Stanford Sentiment Treebank - binary
  3. OpeNER
  4. SenTube Auto
  5. SenTube Tablets
  6. SemEval 2013 Task 2

Reference

@inproceedings{Ambartsoumian2017,
  author    = {Ambartsoumian, Artaches and Popowich, Fred},
  title     = {Self-Attention: A Better Building Block for Sentiment Analysis Neural Network Classifiers},
  booktitle = {Proceedings of the 9th Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis},
  month     = {November},
  year      = {2018},
  address   = {Brussels, Belgium},
  publisher = {Association for Computational Linguistics},
}

ssan-self-attention-sentiment-analysis-classification's People

Contributors

artaches avatar

Watchers

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