File size: 3,142 Bytes
ded9e95 ab02861 ded9e95 ab02861 ded9e95 ab02861 7259688 ab02861 ded9e95 ab02861 ded9e95 ab02861 ded9e95 ab02861 ded9e95 ab02861 ded9e95 ab02861 ded9e95 ab02861 ded9e95 ab02861 ded9e95 ab02861 ded9e95 51b1d59 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | ---
language: de
license: cc-by-4.0
base_model: lkonle/fiction-gbert-large
pipeline_tag: text-classification
tags:
- german
- literature
- digital-humanities
- narratology
widget:
- text: "Er trat durch die Tür und schloss sie hinter sich."
example_title: action_space
- text: "Vom Hügel aus konnte sie das ganze Tal unter sich liegen sehen."
example_title: visual_space
- text: "Das Zimmer wirkte schwer und bedrückend, als rückten die Wände näher."
example_title: perceived_space
- text: "In der Ecke stand ein Tisch, bedeckt mit staubigen Büchern."
example_title: descriptive_space
- text: "Sie fragte sich, ob er ihr jemals zurückschreiben würde."
example_title: no_space
---
# de-setting-classifier
Sentence-level classifier for the representation of space in German narrative prose.
Fine-tuned from [`lkonle/fiction-gbert-large`](https://huggingface.co/lkonle/fiction-gbert-large)
(BERT-large, pre-trained on German fiction).
German counterpart to
[`katrohrb/en-setting-classifier`](https://huggingface.co/katrohrb/en-setting-classifier);
both models use the same five categories and the same label encoding.
## Categories
| Label | German term | Description |
|---------------------|--------------------|-----------------------------------------------------------------------------|
| `action_space` | Aktionsraum | Space registered through a character's movement and direct physical contact |
| `visual_space` | Anschauungsraum | Space as perceived by a character from a distance |
| `perceived_space` | gestimmter Raum | Space as it carries mood and atmosphere |
| `descriptive_space` | Raumbeschreibung | Things and objects in space, without reference to a character |
| `no_space` | kein Raum | No spatial reference |
Label ids: `0 perceived_space`, `1 action_space`, `2 visual_space`, `3 descriptive_space`,
`4 no_space` (stored in `config.json` as `id2label`).
## Usage
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
name = "katrohrb/de-setting-classifier"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForSequenceClassification.from_pretrained(name).eval()
sentence = "Er trat durch die Tür und schloss sie hinter sich."
with torch.no_grad():
probs = model(**tok(sentence, return_tensors="pt")).logits.softmax(-1)[0]
print(model.config.id2label[int(probs.argmax())])
# → action_space
```
Or with a pipeline:
```python
from transformers import pipeline
clf = pipeline("text-classification", model="katrohrb/de-setting-classifier")
clf("Vom Hügel aus konnte sie das ganze Tal unter sich liegen sehen.")
# → [{'label': 'visual_space', 'score': 0.93}]
```
## Citation
Rohrbacher, K. (2025). Opening Worlds: Narrative Beginnings and the Role of Setting.
CCLS2025 Conference Preprints, 4(1). https://doi.org/10.26083/tuprints-00030149
|