Views
No views yet
1from transformers import pipeline
2from transformers import AutoTokenizer, AutoModelForTokenClassification
3
4tokenizer = AutoTokenizer.from_pretrained("PaDaS-Lab/gbert-legal-ner", use_auth_token="AUTH_TOKEN")
5model = AutoModelForTokenClassification.from_pretrained("PaDaS-Lab/gbert-legal-ner", use_auth_token="AUTH_TOKEN")
6
7ner = pipeline("ner", model=model, tokenizer=tokenizer)
8example = "1. Das Bundesarbeitsgericht ist gemäß § 9 Abs. 2 Satz 2 ArbGG iVm. § 201 Abs. 1 Satz 2 GVG für die beabsichtigte Klage gegen den Bund zuständig ."
9
10results = ner(example)
11print(results)| Abbreviation | Class |
|---|---|
| PER | Person |
| RR | Judge |
| AN | Lawyer |
| LD | Country |
| ST | City |
| STR | Street |
| LDS | Landscape |
| ORG | Organization |
| UN | Company |
| INN | Institution |
| GRT | Court |
| MRK | Brand |
| GS | Law |
| VO | Ordinance |
| EUN | European legal norm |
| VS | Regulation |
| VT | Contract |
| RS | Court decision |
| LIT | Legal literature |
1@conference{icaart23,
2 author={Harshil Darji. and Jelena Mitrović. and Michael Granitzer.},
3 title={German BERT Model for Legal Named Entity Recognition},
4 booktitle={Proceedings of the 15th International Conference on Agents and Artificial Intelligence - Volume 3: ICAART,},
5 year={2023},
6 pages={723-728},
7 publisher={SciTePress},
8 organization={INSTICC},
9 doi={10.5220/0011749400003393},
10 isbn={978-989-758-623-1},
11 issn={2184-433X},
12}