File size: 10,949 Bytes
d8809cb
 
 
 
 
 
 
 
 
 
 
 
f3ea1ce
4970c4e
 
 
 
1942e97
bf42b1f
 
 
 
 
 
 
 
d8809cb
 
 
 
328a68d
 
d8809cb
 
 
 
 
57dde9d
d8809cb
 
328a68d
 
d8809cb
57dde9d
d8809cb
 
 
 
328a68d
d8809cb
57dde9d
d8809cb
 
f3ea1ce
d8809cb
 
 
 
 
 
 
 
 
1942e97
 
 
 
d8809cb
 
 
bf42b1f
 
 
 
d8809cb
 
bf42b1f
 
 
 
d8809cb
 
 
 
 
 
328a68d
d8809cb
328a68d
d8809cb
57dde9d
d8809cb
 
 
328a68d
d8809cb
 
57dde9d
d8809cb
 
 
 
328a68d
 
 
 
 
 
 
 
 
 
 
d8809cb
328a68d
d8809cb
 
 
57dde9d
 
328a68d
d8809cb
7e4897b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
license: mit
datasets:
- danielsteinigen/KeyFiTax
language:
- de
library_name: transformers
tags:
- legal
- tax law
- relation extraction
- entity extraction
widget:
- text: "[GRP-01]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das Kindergeld beträgt monatlich für das erste und zweite Kind jeweils 219 Euro, für das dritte Kind 225 Euro und für das vierte und jedes weitere Kind jeweils 250 Euro."
  example_title: "Key Figures"
- text: "[GRP-00]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das Kindergeld beträgt monatlich für das erste und zweite Kind jeweils 219 Euro, für das dritte Kind 225 Euro und für das vierte und jedes weitere Kind jeweils 250 Euro."
  example_title: "Conditions"
- text: "[REL]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das [SUB][ENT-01]Kindergeld[/ENT-01][/SUB] beträgt [OBJ][ENT-07]monatlich[/ENT-07][/OBJ] [OBJ][ENT-02]für das erste und zweite Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]219[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ], [OBJ][ENT-02]für das dritte Kind[/ENT-02][/OBJ] [OBJ][ENT-03]225[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ] und [OBJ][ENT-02]für das vierte und jedes weitere Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]250[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ]."
  example_title: "Relations 1"
- text: "[REL]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das [OBJ][ENT-01]Kindergeld[/ENT-01][/OBJ] beträgt [OBJ][ENT-07]monatlich[/ENT-07][/OBJ] [OBJ][ENT-02]für das erste und zweite Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [SUB][ENT-03]219[/ENT-03][/SUB] [OBJ][ENT-04]Euro[/ENT-04][/OBJ], [OBJ][ENT-02]für das dritte Kind[/ENT-02][/OBJ] [OBJ][ENT-03]225[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ] und [OBJ][ENT-02]für das vierte und jedes weitere Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]250[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ]."
  example_title: "Relations 2"
- text: "[REL]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das [OBJ][ENT-01]Kindergeld[/ENT-01][/OBJ] beträgt [OBJ][ENT-07]monatlich[/ENT-07][/OBJ] [OBJ][ENT-02]für das erste und zweite Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]219[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ], [OBJ][ENT-02]für das dritte Kind[/ENT-02][/OBJ] [SUB][ENT-03]225[/ENT-03][/SUB] [OBJ][ENT-04]Euro[/ENT-04][/OBJ] und [OBJ][ENT-02]für das vierte und jedes weitere Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]250[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ]."
  example_title: "Relations 3"
- text: "[REL]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das [OBJ][ENT-01]Kindergeld[/ENT-01][/OBJ] beträgt [OBJ][ENT-07]monatlich[/ENT-07][/OBJ] [OBJ][ENT-02]für das erste und zweite Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]219[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ], [OBJ][ENT-02]für das dritte Kind[/ENT-02][/OBJ] [OBJ][ENT-03]225[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ] und [OBJ][ENT-02]für das vierte und jedes weitere Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [SUB][ENT-03]250[/ENT-03][/SUB] [OBJ][ENT-04]Euro[/ENT-04][/OBJ]."
  example_title: "Relations 4"
  
---

# Model Card for Model ID

This model performs entity extraction and relation extraction in a combined manner, using __*entity markers*__ and __*task triggers*__.
It processes German tax laws as input and outputs the extracted key figures with their properties and relations, based on a developed semantic model.

## Model Details

### Model Description

This is a fine-tuned token classification model, based on XLM-RoBERTa-Large, for the extraction of key figures and their logical connected properties from german tax legal texts. The entity- and relation extraction tasks are trained in a combined model using initial trigger token to distinguish between the tasks. For relation extraction additional tokens are used to mark the extracted entities and predict the relations between them.


- **Model type:** fine-tuned token classification model, based on XLM-RoBERTa-Large
- **Language(s) (NLP):** German

### Model Sources

<!-- Provide the basic links for the model. -->

- **Repository:** https://github.com/danielsteinigen/nlp-legal-texts
- **Paper:** https://ceur-ws.org/Vol-3441/paper7.pdf
- **Demo:** https://huggingface.co./spaces/danielsteinigen/NLP-Legal-Texts
- **Data:** https://huggingface.co./datasets/danielsteinigen/KeyFiTax

## Uses
```python
from transformers import AutoTokenizer, AutoModelForTokenClassification
from transformers import pipeline

tokenizer = AutoTokenizer.from_pretrained("danielsteinigen/KeyFiTax")
model = AutoModelForTokenClassification.from_pretrained("danielsteinigen/KeyFiTax")

nlp = pipeline("ner", model=model, tokenizer=tokenizer)
key_figures = "[GRP-01]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das Kindergeld beträgt monatlich für das erste und zweite Kind jeweils 219 Euro, für das dritte Kind 225 Euro und für das vierte und jedes weitere Kind jeweils 250 Euro."
conditions = "[GRP-00]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das Kindergeld beträgt monatlich für das erste und zweite Kind jeweils 219 Euro, für das dritte Kind 225 Euro und für das vierte und jedes weitere Kind jeweils 250 Euro."
relations_1 = "[REL]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das [SUB][ENT-01]Kindergeld[/ENT-01][/SUB] beträgt [OBJ][ENT-07]monatlich[/ENT-07][/OBJ] [OBJ][ENT-02]für das erste und zweite Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]219[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ], [OBJ][ENT-02]für das dritte Kind[/ENT-02][/OBJ] [OBJ][ENT-03]225[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ] und [OBJ][ENT-02]für das vierte und jedes weitere Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]250[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ]."
relations_2 = "[REL]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das [OBJ][ENT-01]Kindergeld[/ENT-01][/OBJ] beträgt [OBJ][ENT-07]monatlich[/ENT-07][/OBJ] [OBJ][ENT-02]für das erste und zweite Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [SUB][ENT-03]219[/ENT-03][/SUB] [OBJ][ENT-04]Euro[/ENT-04][/OBJ], [OBJ][ENT-02]für das dritte Kind[/ENT-02][/OBJ] [OBJ][ENT-03]225[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ] und [OBJ][ENT-02]für das vierte und jedes weitere Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]250[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ]."
relations_3 = "[REL]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das [OBJ][ENT-01]Kindergeld[/ENT-01][/OBJ] beträgt [OBJ][ENT-07]monatlich[/ENT-07][/OBJ] [OBJ][ENT-02]für das erste und zweite Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]219[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ], [OBJ][ENT-02]für das dritte Kind[/ENT-02][/OBJ] [SUB][ENT-03]225[/ENT-03][/SUB] [OBJ][ENT-04]Euro[/ENT-04][/OBJ] und [OBJ][ENT-02]für das vierte und jedes weitere Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]250[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ]."
relations_4 = "[REL]EStG § 66 Höhe des Kindergeldes, Zahlungszeitraum (1) Das [OBJ][ENT-01]Kindergeld[/ENT-01][/OBJ] beträgt [OBJ][ENT-07]monatlich[/ENT-07][/OBJ] [OBJ][ENT-02]für das erste und zweite Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [OBJ][ENT-03]219[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ], [OBJ][ENT-02]für das dritte Kind[/ENT-02][/OBJ] [OBJ][ENT-03]225[/ENT-03][/OBJ] [OBJ][ENT-04]Euro[/ENT-04][/OBJ] und [OBJ][ENT-02]für das vierte und jedes weitere Kind[/ENT-02][/OBJ] [OBJ][ENT-07]jeweils[/ENT-07][/OBJ] [SUB][ENT-03]250[/ENT-03][/SUB] [OBJ][ENT-04]Euro[/ENT-04][/OBJ]."

results_key_figures = nlp(key_figures)
results_conditions  = nlp(conditions)
results_relations_1   = nlp(relations_1)
results_relations_2   = nlp(relations_2)
results_relations_3   = nlp(relations_3)
results_relations_4   = nlp(relations_4)
print(results_key_figures)
print(results_conditions)
print(results_relations_1)
print(results_relations_2)
print(results_relations_3)
print(results_relations_4)


```

## Training Details

Training details can be found in our paper: [https://ceur-ws.org/Vol-3441/paper7.pdf](https://ceur-ws.org/Vol-3441/paper7.pdf)

### Training Data

The model is trained on our dataset __*KeyFiTax*__, which is published here: [https://huggingface.co./datasets/danielsteinigen/KeyFiTax](https://huggingface.co./datasets/danielsteinigen/KeyFiTax)

## Evaluation

Evaluation details can be found in our paper: [https://ceur-ws.org/Vol-3441/paper7.pdf](https://ceur-ws.org/Vol-3441/paper7.pdf)


## Citation

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

**BibTeX:**
```
@inproceedings{steinigen2023semantic,
  title={Semantic Extraction of Key Figures and Their Properties From Tax Legal Texts Using Neural Models},
  author={Steinigen, Daniel and Namysl, Marcin and Hepperle, Markus and Krekeler, Jan and Landgraf, Susanne},
  url = {https://ceur-ws.org/Vol-3441/paper7.pdf},
  year={2023}
  journal={Sixth Workshop on Automated Semantic Analysis of Information in Legal Text (ASAIL 2023)}, 
  series = {CEUR Workshop Proceedings},
  venue = {Braga, Portugal},
  eventdate = {2023-06-23}
}

```

**APA:**

Steinigen, D., Namysl, M., Hepperle, M., Krekeler, J., & Landgraf, S. (2023). Semantic Extraction of Key Figures and Their Properties From Tax Legal Texts Using Neural Models. 
Proceedings of Sixth Workshop on Automated Semantic Analysis of Information in Legal Text, Braga, Portugal, June 23, 2023. 
CEUR-WS.org, online CEUR-WS.org/Vol-3441/paper7.pdf.

## Additional Information

### Licensing Information
```
MIT License

Copyright (c) 2023 Daniel Steinigen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```