BESSTIE BERT-GRU Sentiment Classifier

This repository contains custom PyTorch sentiment classifiers for the BESSTIE coursework experiment.

The architecture is:

bert-base-uncased -> 2-layer bidirectional GRU -> linear sentiment head

The model outputs one logit and should be interpreted with torch.sigmoid():

  • probability >= 0.5: Positive
  • probability < 0.5: Negative

Files

  • transformer-model-inner.pt: trained on Inner-Circle English varieties.
  • transformer-model-outer.pt: trained on Outer-Circle / Indian English.
  • modeling_bert_gru.py: model architecture and loading helpers.
  • config.json: architecture metadata.

Loading

from huggingface_hub import hf_hub_download
from transformers import BertTokenizer
from modeling_bert_gru import load_model, predict_sentiment

repo_id = "YOUR_USERNAME/besstie-bert-gru-sentiment"

checkpoint_path = hf_hub_download(repo_id, filename="transformer-model-inner.pt")

tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
model = load_model(checkpoint_path)

result = predict_sentiment(
    model,
    tokenizer,
    "Traditional friendly pub with excellent beer and warm service."
)

print(result)
Downloads last month
6
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for milesrack/besstie-bert-gru-sentiment

Finetuned
(6869)
this model