Edit model card

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

Uses

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

Training Data

The model is trained on our dataset KeyFiTax, which is published here: https://huggingface.co/datasets/danielsteinigen/KeyFiTax

Evaluation

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

Citation

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.
Downloads last month
18
Safetensors
Model size
559M params
Tensor type
I64
·
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Dataset used to train danielsteinigen/KeyFiTax

Space using danielsteinigen/KeyFiTax 1