added model card
Browse files
README.md
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- de
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
tags:
|
7 |
+
- german
|
8 |
+
- deutsch
|
9 |
+
- simplification
|
10 |
+
- vereinfachung
|
11 |
+
---
|
12 |
+
# Model Card for Model ID
|
13 |
+
|
14 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
15 |
+
|
16 |
+
This model was used in our experiments in our paper: [Elaborative Simplification for German-Language Texts](https://aclanthology.org/2024.sigdial-1.3).
|
17 |
+
We have uploaded this model for transparency and replicability of our experiments.
|
18 |
+
If however you are interested in German text simplification in general, we recommend [our more recent model](https://huggingface.co/hiig-piai/simba_best_092024).
|
19 |
+
|
20 |
+
We fine-tuned [meta-llama/Meta-Llama-3-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct) with a set of ca. 2000 newspaper articles which have been simplified by the Austrian Press Agency.
|
21 |
+
This model was trained with the standard and the B1 level texts.
|
22 |
+
|
23 |
+
## Model Details
|
24 |
+
|
25 |
+
### Model Description
|
26 |
+
|
27 |
+
<!-- Provide a longer summary of what this model is. -->
|
28 |
+
|
29 |
+
|
30 |
+
|
31 |
+
- **Developed by:** Freya Hewett, Hadi Asghari
|
32 |
+
- **Model type:** simplification model, text generation
|
33 |
+
- **Language(s) (NLP):** German
|
34 |
+
- **License:** Apache 2.0
|
35 |
+
- **Finetuned from model:** meta-llama/Meta-Llama-3-8B-Instruct
|
36 |
+
|
37 |
+
### Model Sources
|
38 |
+
|
39 |
+
<!-- Provide the basic links for the model. -->
|
40 |
+
|
41 |
+
- **Repository:** [GermanElabSimplification](https://github.com/fhewett/GermanElabSimplification/tree/main)
|
42 |
+
- **Paper:** [Elaborative Simplification for German-Language Texts](https://aclanthology.org/2024.sigdial-1.3)
|
43 |
+
|
44 |
+
## Uses
|
45 |
+
|
46 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
47 |
+
|
48 |
+
### Direct Use
|
49 |
+
|
50 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
51 |
+
|
52 |
+
This model works best for simplifying German-language newspaper articles (news items, not commentaries or editorials). It may work for other types of texts.
|
53 |
+
|
54 |
+
### Downstream Use
|
55 |
+
|
56 |
+
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
57 |
+
We have fine-tuned using only newspaper articles. We have not yet performed extensive out-of-domain testing, but believe that the model's capabilities could be improved by fine-tuning on more diverse data.
|
58 |
+
|
59 |
+
<!-- ### Out-of-Scope Use -->
|
60 |
+
|
61 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
62 |
+
|
63 |
+
## Bias, Risks, and Limitations
|
64 |
+
|
65 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
66 |
+
|
67 |
+
As with most text generation models, the model sometimes produces information that is incorrect.
|
68 |
+
|
69 |
+
### Recommendations
|
70 |
+
|
71 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
72 |
+
|
73 |
+
Please check manually that your output text corresponds to the input text, as factual inconsistencies may have arisen.
|
74 |
+
|
75 |
+
## How to Get Started with the Model
|
76 |
+
|
77 |
+
To load the model using transformers:
|
78 |
+
|
79 |
+
```
|
80 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
81 |
+
import torch
|
82 |
+
device = "cuda"
|
83 |
+
tokenizer = AutoTokenizer.from_pretrained("frhew/sigdial_ft_b1")
|
84 |
+
model = AutoModelForCausalLM.from_pretrained("frhew/sigdial_ft_b1", torch_dtype=torch.float16).to(device)
|
85 |
+
```
|
86 |
+
|
87 |
+
We used the following prompt at inference to test our model:
|
88 |
+
|
89 |
+
```
|
90 |
+
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
91 |
+
Du bist ein hilfreicher Assistent und hilfst dem User, Texte besser zu verstehen.<|eot_id|><|start_header_id|>user<|end_header_id|>
|
92 |
+
Kannst du bitte den folgenden Text zusammenfassen und sprachlich auf ein B1-Niveau in Deutsch vereinfachen? Schreibe maximal 5 Sätze.
|
93 |
+
{input_text}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
94 |
+
```
|
95 |
+
|
96 |
+
## Training Details
|
97 |
+
|
98 |
+
### Training Data
|
99 |
+
|
100 |
+
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
101 |
+
|
102 |
+
A sample of the data used to train our model can be found [here](https://github.com/fhewett/apa-rst/tree/main/original_texts).
|
103 |
+
|
104 |
+
#### Training Hyperparameters
|
105 |
+
|
106 |
+
<!--- **Training regime:** Our training script can be found [here](https://github.com/fhewett/simba/blob/main/models/train_simba.py). -->
|
107 |
+
<!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
108 |
+
|
109 |
+
<!-- #### Speeds, Sizes, Times [optional] -->
|
110 |
+
|
111 |
+
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
112 |
+
|
113 |
+
## Evaluation
|
114 |
+
|
115 |
+
The right hand side shows the results of the manual evaluation, done on the outputs from each model for 35 texts. M.P. stands for meaning preservation, S for simplification, C for coherence, F for factuality; the score represents the percentage of *yes* answers.
|
116 |
+
More details on the evaluation can be found in the paper. For all metrics, higher is better.
|
117 |
+
|
118 |
+
| **Model** | **Prompt** | **Test set** | **SARI** | **FRE** | **M.P.** | **S** | **C** | **F** | **Avg.** |
|
119 |
+
|--------------------|---------------------|-----------------------|------------------------------|-----------------------------|------------------------------|---------------------------|---------------------------|---------------------------|------------------------------|
|
120 |
+
| Baseline | Basic | A2 | 41.2 | 59.4 | .89 | .38 | .96 | .84 | .77 |
|
121 |
+
| FT-A2 | Basic | A2 | 44.0 | 70.6 | .49 | .82 | .56 | .64 | .63 |
|
122 |
+
| Baseline | Basic | B1 | 42.3 | 56.8 | .85 | .4 | .9 | .9 | .76 |
|
123 |
+
| FT-B1 | Basic | B1 | 42.4 | 60.0 | .75 | .55 | .6 | .75 | .66 |
|
124 |
+
|
125 |
+
|
126 |
+
#### Summary
|
127 |
+
|
128 |
+
|
129 |
+
## Citation
|
130 |
+
|
131 |
+
**BibTeX:**
|
132 |
+
|
133 |
+
@inproceedings{hewett-etal-2024-elaborative,
|
134 |
+
title = "Elaborative Simplification for {G}erman-Language Texts",
|
135 |
+
author = "Hewett, Freya and
|
136 |
+
Asghari, Hadi and
|
137 |
+
Stede, Manfred",
|
138 |
+
editor = "Kawahara, Tatsuya and
|
139 |
+
Demberg, Vera and
|
140 |
+
Ultes, Stefan and
|
141 |
+
Inoue, Koji and
|
142 |
+
Mehri, Shikib and
|
143 |
+
Howcroft, David and
|
144 |
+
Komatani, Kazunori",
|
145 |
+
booktitle = "Proceedings of the 25th Annual Meeting of the Special Interest Group on Discourse and Dialogue",
|
146 |
+
month = sep,
|
147 |
+
year = "2024",
|
148 |
+
address = "Kyoto, Japan",
|
149 |
+
publisher = "Association for Computational Linguistics",
|
150 |
+
url = "https://aclanthology.org/2024.sigdial-1.3",
|
151 |
+
doi = "10.18653/v1/2024.sigdial-1.3",
|
152 |
+
pages = "29--39"}
|
153 |
+
|
154 |
+
**APA:**
|
155 |
+
|
156 |
+
Freya Hewett, Hadi Asghari, and Manfred Stede. 2024. Elaborative Simplification for German-Language Texts. In Proceedings of the 25th Annual Meeting of the Special Interest Group on Discourse and Dialogue, pages 29–39, Kyoto, Japan. Association for Computational Linguistics.
|
157 |
+
|
158 |
+
## Model Card Contact
|
159 |
+
|
160 |
+
frhew
|