How to use in Flair

from flair.data import Sentence
from flair.models import SequenceTagger

# load tagger
tagger = SequenceTagger.load("elenanereiss/German-legal-NER-flert")
sentence = Sentence("""Gemäß § 160 Abs 2 Nr 3 Halbs 2 SGG kann der geltend gemachte Verfahrensmangel allerdings nicht auf eine Verletzung der §§ 109 und 128 Abs 1 S 1 SGG und auf eine Verletzung des § 103 SGG nur gestützt werden, wenn er sich auf einen Beweisantrag bezieht, dem das LSG ohne hinreichende Begründung nicht gefolgt ist.
""")
tagger.predict(sentence)
print(sentence.to_tagged_string())

Results:

  • F-score (micro) 0.9804
  • F-score (macro) 0.9636
  • Accuracy 0.9664

Results by class:

              precision    recall  f1-score   support

          GS     0.9891    0.9950    0.9920      1818
          RS     0.9928    0.9936    0.9932      1245
         GRT     0.9969    0.9875    0.9922       321
         LIT     0.9628    0.9904    0.9765       314
          VT     0.9562    0.9793    0.9676       290
         INN     0.9762    0.9234    0.9491       222
         PER     0.9645    0.9422    0.9532       173
         EUN     0.9542    0.9733    0.9637       150
          RR     1.0000    1.0000    1.0000       142
          LD     1.0000    0.8725    0.9319       149
         ORG     0.9304    0.9469    0.9386       113
          UN     1.0000    0.9907    0.9953       108
          VO     0.9365    0.8310    0.8806        71
          VS     0.8714    0.9531    0.9104        64
          ST     0.9219    0.9219    0.9219        64
         MRK     1.0000    1.0000    1.0000        32
         LDS     1.0000    0.9545    0.9767        22
         STR     1.0000    0.9333    0.9655        15
          AN     1.0000    1.0000    1.0000         9
          
   micro avg     0.9814    0.9795    0.9804      5322
   macro avg     0.9712    0.9573    0.9636      5322
weighted avg     0.9816    0.9795    0.9803      5322

Flair Model Card

  • this Flair model was trained with:
  • Flair version 0.14.0
  • PyTorch version 2.4.1+cu121
  • Transformers version 4.46.0.dev0

Training Parameters

  • model_name_or_path: "google-bert/bert-base-german-cased"
  • learning_rate: "5e-05"
  • mini_batch_size: "32"
  • max_epochs: "35"
  • context_size: "64"
Downloads last month
26
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for elenanereiss/German-legal-NER-flert

Finetuned
(169)
this model

Dataset used to train elenanereiss/German-legal-NER-flert