Skip to content

LongBaoCoder2/sarcasm-detector

Repository files navigation

sarcasm-detector

This project implements a multimodal sarcasm detection model that combines image and text features to classify different types of sarcasm. The model is designed to effectively fuse features from multiple modalities, handle imbalanced datasets, and improve generalization using auxiliary tasks and specialized loss functions.

Features of the Architecture

  1. Low-Rank Fusion Module: Compresses and combines features from the text and image embeddings to reduce dimensionality while maintaining essential information.
  2. Text Encoder: The model uses a pre-trained text encoder ViSoBERT
  3. Image Encoder: A CLIP-based image encoder extracts visual features from input images.

Overcoming Imbalanced Datasets

  1. Focal Loss: This loss function gives more focus to minority classes (e.g., text-sarcasm and image-sarcasm) by dynamically scaling the gradient of easy samples.
  2. Auxiliary Losses:
    • For text-sarcasm: The model ensures text-based features dominate the prediction by leveraging text-specific auxiliary outputs.
    • For image-sarcasm: Fused embeddings are emphasized for prediction, ensuring better understanding of visual sarcasm.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages