Giter VIP home page Giter VIP logo

tweet-classifier-with-uncertainty's Introduction

Disaster Tweet Classifier with Uncertainty

This project explores incorporating uncertainty into binary classification of tweets, specifically identifying tweets related to disasters. It experiments with blending traditional NLP techniques and Bayesian inference to provide not only a classification but also a measure of confidence in that classification.

Architecture Overview

  • NLP Model: Utilizes GPT-2 for converting tweets into embeddings, serving as a nuanced representation of the textual data.
  • Classification Model: A neural network built with PyTorch that takes GPT-2 embeddings as input and predicts two parameters (alpha and beta) of a Beta distribution. This distribution represents the probability of a tweet being disaster-related along with the uncertainty of the prediction.
    • Input Layer: Receives the GPT-2 embeddings.
    • Hidden Layer(s): Processes the embeddings through one or more layers with non-linear activation functions.
    • Output Layer: Outputs two values, alpha and beta, parameters of the Beta distribution.
  • Loss Function: A custom loss function that combines Binary Cross-Entropy (BCE) for accuracy and a penalty for variance, encouraging the model to be both accurate and confident in its predictions.

Quick Start

To get started, clone the repository, set up a virtual environment, install dependencies, and run the provided Jupyter notebook:

git clone <repository-url>
cd <repository-directory>
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
jupyter notebook disaster_tweet_classifier.ipynb

tweet-classifier-with-uncertainty's People

Contributors

idobiga avatar

Watchers

Ido Zehori 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.