katrohrb/en-setting-classifier
033
en-setting-classifier
Sentence-level classifier for the representation of space in English narrative prose. Fine-tuned from `FacebookAI/roberta-base`.
English counterpart to `katrohrb/de-setting-classifier`; both models use the same five categories and the same label encoding.
Categories
Label ids: 0 perceived_space, 1 action_space, 2 visual_space, 3 descriptive_space, 4 no_space (stored in config.json as id2label).
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
name = "katrohrb/en-setting-classifier"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForSequenceClassification.from_pretrained(name).eval()
sentence = "He walked through the door and shut it behind him."
with torch.no_grad():
probs = model(**tok(sentence, return_tensors="pt")).logits.softmax(-1)[0]
print(model.config.id2label[int(probs.argmax())])
# → action_spaceOr with a pipeline:
from transformers import pipeline
clf = pipeline("text-classification", model="katrohrb/en-setting-classifier")
clf("From the hilltop she could see the whole valley spread out below.")
# → [{'label': 'visual_space', 'score': 0.87}]Citation
Rohrbacher, K., Nieth, B., Salin, E., Eskofier, B., Mahlberg, M. (2026). How LLMs Build Fictional Worlds: Measuring Setting and Narrative Space in AI-Generated Creative Storytelling. Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing (EMNLP). To appear. Preprint: https://doi.org/10.48550/arXiv.2609.02482
