Token Classification
Transformers
German
frame-semantics
framenet
salsa
german
semantic-parsing
srl
argument-extraction
Instructions to use texturejc/texture-frames-de-args with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use texturejc/texture-frames-de-args with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="texturejc/texture-frames-de-args")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("texturejc/texture-frames-de-args", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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: token-classification
|
| 9 |
+
tags:
|
| 10 |
+
- frame-semantics
|
| 11 |
+
- framenet
|
| 12 |
+
- salsa
|
| 13 |
+
- german
|
| 14 |
+
- semantic-parsing
|
| 15 |
+
- srl
|
| 16 |
+
- argument-extraction
|
| 17 |
+
base_model: deepset/gbert-large
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# texture-frames-de · argument-extraction head
|
| 21 |
+
|
| 22 |
+
The **argument-extraction** stage of
|
| 23 |
+
[`texture-frames-de`](https://github.com/texturejc/texture-frames-de), a German
|
| 24 |
+
frame-semantic parser. Given a sentence with a marked trigger and its frame, it
|
| 25 |
+
finds the spans that fill the frame's roles (frame elements) and labels each.
|
| 26 |
+
|
| 27 |
+
It fine-tunes [`deepset/gbert-large`](https://huggingface.co/deepset/gbert-large)
|
| 28 |
+
on the **[SALSA](https://www.coli.uni-saarland.de/projects/salsa/) 2.0** corpus
|
| 29 |
+
with a **detect-then-classify** design — two heads on one backbone, a single
|
| 30 |
+
forward pass:
|
| 31 |
+
|
| 32 |
+
- **Head A — span detection:** a role-agnostic 3-class BIO tagger (`O`/`B`/`I`),
|
| 33 |
+
"is this token part of *an* argument?". Dense signal, arbitrary-length spans.
|
| 34 |
+
- **Head B — role classification:** for each detected span, pool its tokens
|
| 35 |
+
(`start ⊕ end ⊕ mean`) and classify into **only the current frame's frame
|
| 36 |
+
elements** (plus a `NULL` reject class), masked via the bundled lexicon.
|
| 37 |
+
|
| 38 |
+
The input carries the predicate marker and the frame's FE menu
|
| 39 |
+
(`{frame} [FE1; FE2; …] : … <t> {trigger} </t> …`). A **`NULL`-bias** at inference
|
| 40 |
+
sets the precision/recall operating point.
|
| 41 |
+
|
| 42 |
+
> This is one of three stages. Use it through the package rather than alone.
|
| 43 |
+
|
| 44 |
+
## Usage
|
| 45 |
+
|
| 46 |
+
```bash
|
| 47 |
+
pip install git+https://github.com/texturejc/texture-frames-de
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
from texture_frames_de import FrameParser
|
| 52 |
+
parser = FrameParser() # downloads this + the frame head on first use
|
| 53 |
+
for ann in parser.parse("Die Polizei verhaftete den Verdächtigen ."):
|
| 54 |
+
print([(a.role, a.text) for a in ann.arguments])
|
| 55 |
+
# [('Authorities', 'Die Polizei'), ('Suspect', 'den Verdächtigen')]
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
Lower `null_bias` (default 2.0) for higher argument recall:
|
| 59 |
+
`FrameParser(null_bias=0.0)`.
|
| 60 |
+
|
| 61 |
+
## Files
|
| 62 |
+
|
| 63 |
+
| File | What |
|
| 64 |
+
| ---- | ---- |
|
| 65 |
+
| `args2_model.pt` | model `state_dict` (backbone + detection + role heads) |
|
| 66 |
+
| `role2id.json` | `{role name → id}` label map (incl. `<NULL>`) + `base_model` |
|
| 67 |
+
| tokenizer files | gbert-large tokenizer with the `<t>` / `</t>` markers added |
|
| 68 |
+
|
| 69 |
+
The custom head (`Args2Model`) is defined in the package; loading is handled by
|
| 70 |
+
`texture_frames_de.weights.load_args`.
|
| 71 |
+
|
| 72 |
+
## Results
|
| 73 |
+
|
| 74 |
+
Test split (held-out 10% of SALSA sentences), operating point picked on dev:
|
| 75 |
+
|
| 76 |
+
| Metric | Value |
|
| 77 |
+
| ------ | ----- |
|
| 78 |
+
| Weighted F1 (non-core FEs = 0.5) | **0.844** (P 0.884 / R 0.808, NULL-bias 2.0) |
|
| 79 |
+
| Speed | ~17 ms/example (single forward pass) |
|
| 80 |
+
|
| 81 |
+
**Not directly comparable** to the English `texture-frames` args head: SALSA role
|
| 82 |
+
spans are syntactic *constituents* (clean boundaries), which flatters exact-span
|
| 83 |
+
F1 relative to FrameNet's looser character spans. Discontinuous role spans (13.8%
|
| 84 |
+
of gold, from German verb brackets / extraposition) are represented and scored as
|
| 85 |
+
their enclosing span. Read as a strong standalone German result.
|
| 86 |
+
|
| 87 |
+
## Training
|
| 88 |
+
|
| 89 |
+
`deepset/gbert-large`, 5 epochs, AdamW lr 1e-5, warmup 0.06, weight decay 0.01,
|
| 90 |
+
batch 16, max length 320, bf16, 4 sampled `NULL` negative spans/example. Data:
|
| 91 |
+
SALSA 2.0, 80/10/10 split by sentence id. See the
|
| 92 |
+
[repo](https://github.com/texturejc/texture-frames-de) for the training notebook.
|
| 93 |
+
|
| 94 |
+
## Licence
|
| 95 |
+
|
| 96 |
+
**Code (the package): MIT.** **Weights: for non-commercial research use.** They are
|
| 97 |
+
trained on **SALSA**, layered on **TIGER** — both **academic / non-commercial**
|
| 98 |
+
licences, with SALSA additionally restricting commercial use of derived data.
|
| 99 |
+
Review the [SALSA](https://www.coli.uni-saarland.de/projects/salsa/corpus/) and
|
| 100 |
+
TIGER licence terms before any commercial use or redistribution. The corpus itself
|
| 101 |
+
is not distributed here and must be obtained under licence.
|
| 102 |
+
|
| 103 |
+
## Citation
|
| 104 |
+
|
| 105 |
+
```bibtex
|
| 106 |
+
@software{texture_frames_de,
|
| 107 |
+
author = {Carney, James},
|
| 108 |
+
title = {texture-frames-de: a German frame-semantic parser (gbert / SALSA)},
|
| 109 |
+
url = {https://github.com/texturejc/texture-frames-de},
|
| 110 |
+
year = {2026}
|
| 111 |
+
}
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
Builds on David Chanin's `frame-semantic-transformer` and its encoder
|
| 115 |
+
rearchitecture [`texture-frames`](https://github.com/texturejc/Texture_Frames);
|
| 116 |
+
thanks to the SALSA and TIGER projects and to deepset for `gbert-large`.
|