CoolFace
Modelpublic

mjpsm/Griot-Story-Identifier-1k-v1

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes11downloads
Model Card

๐Ÿ“– Griot Story Identifier (1,000 Rows, DistilBERT)

This is a fine-tuned binary text classification model that predicts whether a given passage contains a story (story) or does not (not_story). It was trained on a synthetic dataset of 1,000 rows, with each input text being โ‰ฅ 300 words.


๐Ÿงพ Model Details

  • โ€”Base model: `distilbert-base-uncased`
  • โ€”Task: Binary text classification (story vs. not_story)
  • โ€”Dataset size: 1,000 rows (balanced)
  • โ€”Sequence length: 256 max tokens
  • โ€”Training epochs: 4
  • โ€”Framework: ๐Ÿค— Transformers + PyTorch

๐Ÿ“Š Labels

  • โ€”story โ†’ text contains a narrative arc (beginning, middle, end, events, characters)
  • โ€”not_story โ†’ text is descriptive, conversational, or factual without a narrative arc

๐Ÿš€ Usage

Load the model directly from the Hub:

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

repo_id = "mjpsm/Griot-Story-Identifier-1k-v1"

tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForSequenceClassification.from_pretrained(repo_id)

text = """
Last summer, my friends and I built a treehouse in the backyard...
(300+ word passage here)
"""

inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
with torch.no_grad():
    logits = model(**inputs).logits
pred_id = int(logits.argmax(dim=-1))
label = model.config.id2label[pred_id]

print("Predicted label:", label)