Git Product home page Git Product logo

sarcasmdetection's Introduction

SarcamDetection

Sarcasm detection on tweets using neural network.
[This repository] perform[s] semantic modelling of sentences using neural networks for the task of sarcasm detection (Ghosh & Veale, 2016).

Pre-requisite

  • nltk (TweetTokenizer)
  • Keras
  • Tensorflow
  • numpy
  • scipy
  • gensim (if you are using word2vec)
  • itertools

Cloning the repository

git clone [email protected]:AniSkywalker/SarcasmDetection.git
cd SarcasmDetection/src/

If you want to use the pre-trained model, you'll have to download it from Google Drive and save it into /resource/text_model/weights/.

Using this package

This code is run by the following command:

python sarcasm_detection_model_CNN_LSTM_DNN.py

Citation

Please cite the following paper when using this code:

Fracking Sarcasm using Neural Network.
Aniruddha Ghosh and Tony Veale. 7th Workshop on Computational Approaches to Subjectivity, Sentiment and Social Media Analysis (WASSA 2016). NAACL-HLT. 16th June 2016, San Diego, California, U.S.A.

Output

The supplied input is rated as either 0 meaning non-sarcastic or 1 meaning sarcastic.

Training

If you want to train the model with your own data, you can save your train, development and test data into the /resource/train, /resource/dev and /resource/test folders correspondingly.

The system accepts dataset in the tab separated format โ€” as shown below. An example can be found in /resource/train/train_v1.txt.

id<tab>label<tab>tweet

Context information

To run the model with context information and psychological dimensions (using Tensorflow) run:

python sarcasm_context_moods.py

Citation

Please cite the following paper when using context information and psychological dimensions:

Magnets for Sarcasm: Making Sarcasm Detection Timely, Contextual and Very Personal
Aniruddha Ghosh and Tony Veale. Conference on Empirical Methods in Natural Language Processing (EMNLP). 7th-11th September, 2017, Copenhagen, Denmark.

Notes

  • Samples of train, dev, and test files are included for both versions.
  • For a test data set, please contact at [email protected]

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.