View on GitHub

SIDATA

Sarcasm Detection using Neural Networks

URL: https://github.com/rishabhmisra/Sarcasm-Detection-using-NN

Description

This repository is a PyTorch implementation of the work presented in the paper “Modelling Context with User Embeddings for Sarcasm Detection in Social Media” (paper link). The neural network model uses the tweet content and corresponding user embeddings (context) to classify tweets as sarcastic or non-sarcastic. The repository also includes an improved framework for sarcasm detection using a Hybrid Neural Network (HNN) approach (paper link).

Methods and Models

System Requirements

Instructions for Running the Code

  1. Pre-requisites:
    • Obtain pre-trained word embeddings (e.g., Skip-gram) and user embeddings (user embeddings link).
    • Place word embeddings in DATA/embeddings/ and name the file words.txt.
    • Place user embeddings in DATA/embeddings/ and name the file usr2vec.txt.
  2. Running the Code:
    • To run the original code:
      python train_CUE_CNN.py  
      
    • To run the RNN + CNN Hybrid model on the new dataset:
      python Headlines_RNN.py  
      

Output, Results, and Visualization

Results

No explicit results (accuracy, precision, recall, F1-score) are provided in the repository. However, the paper associated with this work may contain evaluation metrics.

Note

The utility files, pre-trained user embeddings, and raw tweet IDs were obtained from the Original CUE-CNN repository.