Instructions to use texturejc/texture-frames-frame with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use texturejc/texture-frames-frame with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="texturejc/texture-frames-frame")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("texturejc/texture-frames-frame", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: framenet-academic
|
| 4 |
+
license_link: https://framenet.icsi.berkeley.edu/framenet_data
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
library_name: transformers
|
| 8 |
+
pipeline_tag: text-classification
|
| 9 |
+
tags:
|
| 10 |
+
- frame-semantics
|
| 11 |
+
- framenet
|
| 12 |
+
- semantic-parsing
|
| 13 |
+
- srl
|
| 14 |
+
- english
|
| 15 |
+
base_model: microsoft/deberta-v3-large
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# texture-frames · frame-classification head
|
| 19 |
+
|
| 20 |
+
The **frame-classification** stage of
|
| 21 |
+
[`texture-frames`](https://github.com/texturejc/Texture_Frames), a fast FrameNet
|
| 22 |
+
semantic-frame parser. Given a sentence with a marked trigger, it predicts which
|
| 23 |
+
of ~1,221 FrameNet frames the trigger evokes.
|
| 24 |
+
|
| 25 |
+
It fine-tunes [`microsoft/deberta-v3-large`](https://huggingface.co/microsoft/deberta-v3-large)
|
| 26 |
+
on **FrameNet 1.7** and uses **marker-token pooling**: the trigger is wrapped in
|
| 27 |
+
entity markers (`… <t> gave </t> …`) and the frame representation is the
|
| 28 |
+
concatenation of the two marker tokens' hidden states (not `[CLS]`), focusing the
|
| 29 |
+
classifier on the predicate. A single forward pass — no beam search.
|
| 30 |
+
|
| 31 |
+
> This is one of three stages. Use it through the package rather than alone.
|
| 32 |
+
|
| 33 |
+
## Usage
|
| 34 |
+
|
| 35 |
+
```bash
|
| 36 |
+
pip install git+https://github.com/texturejc/Texture_Frames
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
from texture_frames import FrameParser
|
| 41 |
+
parser = FrameParser()
|
| 42 |
+
for ann in parser.parse("The chef gave food to the customer ."):
|
| 43 |
+
print(ann.trigger, "->", ann.frame)
|
| 44 |
+
# gave -> Giving
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
At inference the logits are **soft-masked** toward the trigger's candidate frames
|
| 48 |
+
(from the FrameNet lexicon) so a confident non-candidate can still win.
|
| 49 |
+
|
| 50 |
+
## Files
|
| 51 |
+
|
| 52 |
+
| File | What |
|
| 53 |
+
| ---- | ---- |
|
| 54 |
+
| `frame2_model.pt` | model `state_dict` (backbone + marker-pooling classifier) |
|
| 55 |
+
| `frame2id.json` | `{frame name → id}` label map + `base_model` |
|
| 56 |
+
| tokenizer files | DeBERTa-v3 tokenizer with the `<t>` / `</t>` markers added |
|
| 57 |
+
|
| 58 |
+
Loading is handled by `texture_frames.weights.load_frame`.
|
| 59 |
+
|
| 60 |
+
## Results
|
| 61 |
+
|
| 62 |
+
Open-Sesame test split:
|
| 63 |
+
|
| 64 |
+
| Metric | This head | T5 baseline |
|
| 65 |
+
| ------ | --------- | ----------- |
|
| 66 |
+
| Frame accuracy | **0.863–0.868** | 0.887 |
|
| 67 |
+
| Speed | single forward pass (~50–60 ms) | 3 beam-search passes |
|
| 68 |
+
|
| 69 |
+
Competitive (~−0.02); the residual gap is largely a candidate-lexicon coverage
|
| 70 |
+
ceiling (2.2% of gold frames fall outside the candidate set), not discrimination.
|
| 71 |
+
|
| 72 |
+
## Training
|
| 73 |
+
|
| 74 |
+
`microsoft/deberta-v3-large`, AdamW lr 1e-5, warmup 0.06, weight decay 0.01,
|
| 75 |
+
batch 16, max length 320, bf16, 5 epochs. Data: FrameNet 1.7 (NLTK), Open-Sesame
|
| 76 |
+
splits.
|
| 77 |
+
|
| 78 |
+
## Licence
|
| 79 |
+
|
| 80 |
+
**Code (the package): MIT.** **Weights:** trained on **FrameNet 1.7**, which
|
| 81 |
+
carries its own academic-use terms — review them before redistributing.
|
| 82 |
+
|
| 83 |
+
## Citation
|
| 84 |
+
|
| 85 |
+
```bibtex
|
| 86 |
+
@software{texture_frames,
|
| 87 |
+
author = {Carney, James},
|
| 88 |
+
title = {texture-frames: a fast DeBERTa encoder FrameNet parser},
|
| 89 |
+
url = {https://github.com/texturejc/Texture_Frames},
|
| 90 |
+
year = {2026}
|
| 91 |
+
}
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
Builds on David Chanin's
|
| 95 |
+
[`frame-semantic-transformer`](https://github.com/chanind/frame-semantic-transformer);
|
| 96 |
+
thanks to the Berkeley FrameNet and Open-Sesame projects.
|