texturejc commited on
Commit
31859a0
·
verified ·
1 Parent(s): 187f0db

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +108 -0
README.md ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ license_name: salsa-tiger-academic
4
+ license_link: https://www.coli.uni-saarland.de/projects/salsa/corpus/doc/license.html
5
+ language:
6
+ - de
7
+ library_name: transformers
8
+ pipeline_tag: text-classification
9
+ tags:
10
+ - frame-semantics
11
+ - framenet
12
+ - salsa
13
+ - german
14
+ - semantic-parsing
15
+ - srl
16
+ base_model: deepset/gbert-large
17
+ ---
18
+
19
+ # texture-frames-de · frame-classification head
20
+
21
+ The **frame-classification** stage of
22
+ [`texture-frames-de`](https://github.com/texturejc/texture-frames-de), a German
23
+ frame-semantic parser. Given a sentence with a marked trigger, it predicts which
24
+ of **1,027 frames** the trigger evokes.
25
+
26
+ It fine-tunes [`deepset/gbert-large`](https://huggingface.co/deepset/gbert-large)
27
+ on the **[SALSA](https://www.coli.uni-saarland.de/projects/salsa/) 2.0** corpus
28
+ and uses **marker-token pooling**: the trigger is wrapped in entity markers
29
+ (`… <t> kündigte </t> …`) and the frame representation is the concatenation of the
30
+ two marker tokens' hidden states (not `[CLS]`), focusing the classifier on the
31
+ predicate. A single forward pass — no beam search.
32
+
33
+ > This is one of three stages. Use it through the package rather than alone; the
34
+ > pipeline handles trigger detection and argument extraction around it.
35
+
36
+ ## Usage
37
+
38
+ ```bash
39
+ pip install git+https://github.com/texturejc/texture-frames-de
40
+ ```
41
+
42
+ ```python
43
+ from texture_frames_de import FrameParser
44
+ parser = FrameParser() # downloads this + the args head on first use
45
+ for ann in parser.parse("Die Polizei verhaftete den Verdächtigen am Bahnhof ."):
46
+ print(ann.frame, "|", ann.trigger)
47
+ # Arrest | verhaftete
48
+ ```
49
+
50
+ At inference the logits are **soft-masked** toward the trigger lemma's candidate
51
+ frames (via a bundled SALSA lexicon + `simplemma` lemmatization), so a confident
52
+ non-candidate can still win while golds outside the top candidate are recovered.
53
+
54
+ ## Files
55
+
56
+ | File | What |
57
+ | ---- | ---- |
58
+ | `frame2_model.pt` | model `state_dict` (backbone + marker-pooling classifier) |
59
+ | `frame2id.json` | `{frame name → id}` label map + `base_model` |
60
+ | tokenizer files | gbert-large tokenizer with the `<t>` / `</t>` markers added |
61
+
62
+ The custom head (`FrameMarkerModel`) is defined in the package; loading is handled
63
+ by `texture_frames_de.weights.load_frame`.
64
+
65
+ ## Results
66
+
67
+ Test split (held-out 10% of SALSA sentences), operating point picked on dev:
68
+
69
+ | Metric | Value |
70
+ | ------ | ----- |
71
+ | Frame accuracy | **0.9045** (candidate bias 4.0) |
72
+ | Candidate-coverage ceiling | 0.984 |
73
+ | Speed | ~16 ms/example (single forward pass) |
74
+
75
+ **Not directly comparable** to the English `texture-frames` frame head — different
76
+ corpus, label space (1,027 vs 1,221), and splits. Read as a strong standalone
77
+ German result.
78
+
79
+ ## Training
80
+
81
+ `deepset/gbert-large`, 5 epochs, AdamW lr 1e-5, warmup 0.06, weight decay 0.01,
82
+ batch 16, max length 320, bf16. Data: SALSA 2.0, 80/10/10 split by sentence id
83
+ (train 30,089 / dev 3,787 / test 3,729 frame instances). See the
84
+ [repo](https://github.com/texturejc/texture-frames-de) for the training notebook.
85
+
86
+ ## Licence
87
+
88
+ **Code (the package): MIT.** **Weights: for non-commercial research use.** They are
89
+ trained on **SALSA**, layered on **TIGER** — both **academic / non-commercial**
90
+ licences, with SALSA additionally restricting commercial use of derived data.
91
+ Review the [SALSA](https://www.coli.uni-saarland.de/projects/salsa/corpus/) and
92
+ TIGER licence terms before any commercial use or redistribution. The corpus itself
93
+ is not distributed here and must be obtained under licence.
94
+
95
+ ## Citation
96
+
97
+ ```bibtex
98
+ @software{texture_frames_de,
99
+ author = {Carney, James},
100
+ title = {texture-frames-de: a German frame-semantic parser (gbert / SALSA)},
101
+ url = {https://github.com/texturejc/texture-frames-de},
102
+ year = {2026}
103
+ }
104
+ ```
105
+
106
+ Builds on David Chanin's `frame-semantic-transformer` and its encoder
107
+ rearchitecture [`texture-frames`](https://github.com/texturejc/Texture_Frames);
108
+ thanks to the SALSA and TIGER projects and to deepset for `gbert-large`.