Views
No views yet
| Metric | Score |
|---|---|
| Accuracy | 79.6% |
| F1 (Strong) | 79.6% |
| Precision (Strong) | 77.7% |
| Recall (Strong) | 81.6% |
| Character Type | Example | Prediction | Confidence |
|---|---|---|---|
| Background (NONE) | Baker, Guard | WEAK ✅ | 98.9%, 98.5% |
| Pure Internal | Haunted Artist | WEAK ✅ | 93.9% |
| Pure External | Military Commander | WEAK ✅ | 94.5% |
| Both (Internal+External) | Conflicted King | STRONG ✅ | 95.1% |
| Both (Trauma+Mission) | PTSD Captain | STRONG ✅ | 95.5% |
| Both (Doubt+Quest) | Uncertain Prophet | STRONG ✅ | 96.0% |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4# Load model and tokenizer
5tokenizer = AutoTokenizer.from_pretrained("plot-arc-classifier")
6model = AutoModelForSequenceClassification.from_pretrained("plot-arc-classifier")
7
8# Example usage
9def classify_character(description):
10 inputs = tokenizer(description, return_tensors="pt", truncation=True, max_length=384)
11
12 with torch.no_grad():
13 outputs = model(**inputs)
14 probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
15 predicted_class = torch.argmax(probabilities, dim=-1).item()
16
17 labels = {0: "WEAK", 1: "STRONG"}
18 confidence = probabilities[0][predicted_class].item()
19
20 return labels[predicted_class], confidence
21
22# Test examples
23examples = [
24 "A baker who makes fresh bread daily and serves customers with a smile.",
25 "A warrior haunted by past failures who must lead a desperate battle to save his homeland while confronting his inner demons.",
26]
27
28for desc in examples:
29 label, conf = classify_character(desc)
30 print(f"'{desc[:50]}...': {label} ({conf:.3f})")1@misc{plot-arc-classifier-2024,
2 title={Plot Arc Character Classifier},
3 author={Generated with Claude Code},
4 year={2024},
5 url={https://huggingface.co/plot-arc-classifier}
6}