distilroberta bias

valurank

Introduction

DISTILROBERTA-BIAS is a text classification model fine-tuned to detect bias in text, categorizing inputs as either neutral or biased. It is a derivative of the distilroberta-base model, which is designed to be a lighter and faster version of RoBERTa.

Architecture

The model architecture is based on the distilroberta-base, which uses a transformer-based approach. It incorporates a classification head to perform binary classification tasks specifically for detecting bias in text.

Training

The model was fine-tuned using the wikirev-bias dataset. This dataset consists of English Wikipedia revisions aimed at identifying biased edits. Further details about the dataset can be found in the WNC wiki edits corpus documentation available on GitHub.

Guide: Running Locally

To run the DISTILROBERTA-BIAS model locally, follow these steps:

  1. Clone the Repository:
    Clone the model repository from Hugging Face to your local machine.

  2. Install Dependencies:
    Ensure you have Python and PyTorch installed. You can install the necessary libraries using pip:

    pip install transformers torch
    
  3. Load the Model:
    Use the transformers library to load the model:

    from transformers import AutoTokenizer, AutoModelForSequenceClassification
    
    tokenizer = AutoTokenizer.from_pretrained("valurank/distilroberta-bias")
    model = AutoModelForSequenceClassification.from_pretrained("valurank/distilroberta-bias")
    
  4. Inference:
    Prepare your inputs and run inference:

    inputs = tokenizer("Your text here", return_tensors="pt", truncation=True, max_length=512)
    outputs = model(**inputs)
    
  5. Cloud GPUs:
    For faster inference, consider using cloud-based GPU services like AWS EC2, Google Cloud Platform, or Azure.

License

The model is provided under an "other" license, which may have specific usage restrictions or requirements. Ensure to review the license before use.

More Related APIs in Text Classification