sentiment_analysis / README.md
ajinathgh's picture
Update README.md
c4491ba verified
metadata
license: mit
library_name: transformers
datasets:
  - stanfordnlp/sst2
language:
  - en
base_model:
  - distilbert/distilbert-base-uncased
pipeline_tag: text-classification
tags:
  - legal
  - PyTorch
  - text-classification
  - sentiment-analysis

Simple Text Classifier

This is a fine-tuned model for text classification based on distilbert-base-uncased.

Model Details

  • Model Type: Text Classification
  • Number of Classes: 2
  • Hidden Size: 768

Usage

from transformers import AutoTokenizer
from huggingface_text_classifier.model import SimpleTextClassifier

# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("ajinathgh/sentiment_analysis")
model = SimpleTextClassifier.from_pretrained("ajinathgh/sentiment_analysis")

# Prepare input
inputs = tokenizer("Example text to classify", return_tensors="pt")

# Get predictions
outputs = model(**inputs)
predicted_class = outputs.argmax(-1).item()