de en

Using transformers to multi-label long legal documents

Hanane el Aajati
Roderick Lucas
Radboud Winkels

Citation: Hanane el Aajati / Roderick Lucas / Radboud Winkels, Using transformers to multi-label long legal documents, in: Jusletter IT 30 March 2023

This paper describes experiments to find an efficient method to multi-label official legal documents using Transformers. Transformers are popular and powerful ML models because they are pre-trained on large amounts of data. A significant drawback is that most Transformers cannot process documents longer than 512 tokens. We try to tackle this issue by proposing a new method to multi-label long documents – summarizing long documents first before multi-labeling with the bert-base-cased Transformer. This summarization method is compared with two existing methods: truncating documents after the first 512 tokens and Longformer. The methods are evaluated on the F1 score, and the results show that the Longformer performs the best. The summarization method and truncating method seem to output almost equal F1 scores. Although the summarization method did not perform well on the dataset used in this research, it could be promising for datasets with more structured documents.


Table of contents

  • 1. Introduction
  • 2. Background
    • 2.1. Bert
    • 2.2. Longformer
    • 2.3. Summarization
    • 2.4. The Data
  • 3. The Experiment
  • 4. Results
  • 5. Conclusions and Future Work
  • 6. References
Please log in to read the full text.
Register for Campus? More
Login Poster
Lenz & Staehelin (Zürich)
Anwältin/Anwalt (Immaterialgüterrecht) Lenz & Staehelin (Zürich)
Kanton St. Gallen (Amt für Handelsregister und Notariate - Amtsnotariat St. Gallen)
Amtsnotar*in und Fachperson [...] Kanton St. Gallen (Amt für [...]
SingleCase GmbH
Executive Sales – Legal Tech (Switzerland) SingleCase GmbH
Domenig & Partner Rechtsanwälte AG
Rechtsanwältin / Rechtsanwalt für [...] Domenig & Partner Rechtsanwälte AG
Domenig & Partner Rechtsanwälte AG
Career Start als Rechtsanwältin / [...] Domenig & Partner Rechtsanwälte AG
BGPartner AG (Bern)
Anwältin | Anwalt 80-100% BGPartner AG (Bern)
EMMENEGGER RECHTSANWÄLTE
Rechtsanwältin / Rechtsanwalt 60-100% EMMENEGGER RECHTSANWÄLTE
Prof. Giger & Partner Rechtsanwälte
Rechtsanwältin / Rechtsanwalt Prof. Giger & Partner Rechtsanwälte
/dam/jcr:0ed7ae66-e1c1-4249-9dea-27540e12da8d/unisg.webp
St.Galler Gesellschaftsrechtstag
/dam/jcr:b4a83ede-c2b1-42e7-b80f-60c5778d8901/ufl_logo.svg
Doktoratsstudium Rechtswissenschafte[...]
/dam/jcr:48e078d1-06c6-4c49-81c7-3704e8d9abf9/Uni_StGallen_irph_logo.webp
CAS Prozessführung – Civil Litigation
/dam/jcr:83f09d58-4a62-41b1-9c9c-02abeb440d40
12. Weblaw Forum LegalTech - AI für [...] Weblaw Academy
/dam/jcr:274399e0-95f5-417e-8939-fe54d7fbfc49/Uni_Basel_Recht_aktuell_Neues_Logo.webp
Art & Law 2026
/dam/jcr:e5a71336-e322-478a-bc1e-ec7f5bf6021a/VUR_logo.svg
Tagung Naturgefahrenrecht im Klimawandel
/dam/jcr:83f09d58-4a62-41b1-9c9c-02abeb440d40
Online-Kurs: AI für die juristische [...] Weblaw Academy
/dam/jcr:d85df556-4302-43d6-aece-94d632ee9245/uni_li_logo.jpg
Intensivkurs „Strafrecht und [...]
/dam/jcr:2513d656-4f19-4079-ac7b-20994bb9e76e/uzh%20logo.webp
CAS Safety in Healthcare
/dam/jcr:8a7f3354-213a-43de-a59d-a7475e221373
Rechtssicher mit KI - Kompaktseminar [...] Begrenzte Plätze.
/dam/jcr:2e9579bd-bc09-4fea-a327-9cd7e3831be2/HSLU_Logo_DE_Schwarz.jpg
MAS Economic Crime Investigation
/dam/jcr:0ed7ae66-e1c1-4249-9dea-27540e12da8d/unisg.webp
St.Galler Arbeitsrechtstagung
/dam/jcr:d85df556-4302-43d6-aece-94d632ee9245/uni_li_logo.jpg
Executive Master of Laws (LL.M.) in [...]
/dam/jcr:c2a09a2e-ee26-4225-a6e7-2d9825723fad
CAS Compliance in Financial Services Institut für Rechtswissenschaft und [...]
/dam/jcr:48e078d1-06c6-4c49-81c7-3704e8d9abf9/Uni_StGallen_irph_logo.webp
CAS Haftpflicht- und Versicherungsrec[...]
/dam/jcr:d85df556-4302-43d6-aece-94d632ee9245/uni_li_logo.jpg
Executive Master of Laws (LL.M.) im [...]
/dam/jcr:035facb2-bbcb-4286-8a34-0499af8dbf1a/uni_freiburg_logo_final.PNG
19. Schweizerischer Datenschutzrechts[...]
/dam/jcr:274399e0-95f5-417e-8939-fe54d7fbfc49/Uni_Basel_Recht_aktuell_Neues_Logo.webp
Praxis im Baurecht
/dam/jcr:d85df556-4302-43d6-aece-94d632ee9245/uni_li_logo.jpg
Executive Master of Laws (LL.M.) im [...]
/dam/jcr:8b6df4d5-09f7-430b-ba5c-c0f8fa36cf22/Paulus_Schriftzug_positiv_CMYK.png
Tagung der Fachgruppe «Reform im [...]
/dam/jcr:2e9579bd-bc09-4fea-a327-9cd7e3831be2/HSLU_Logo_DE_Schwarz.jpg
MAS Information & Cyber Security
/dam/jcr:274399e0-95f5-417e-8939-fe54d7fbfc49/Uni_Basel_Recht_aktuell_Neues_Logo.webp
Gutachten im Strafprozess
/dam/jcr:274399e0-95f5-417e-8939-fe54d7fbfc49/Uni_Basel_Recht_aktuell_Neues_Logo.webp
Recht aktuell: Basler ZPO-Tag 2026
/dam/jcr:8a7f3354-213a-43de-a59d-a7475e221373
Rechtssicher mit KI - Kompaktsemina[...] Begrenzte Plätze.
/dam/jcr:274399e0-95f5-417e-8939-fe54d7fbfc49/Uni_Basel_Recht_aktuell_Neues_Logo.webp
Recht aktuell: 10. Basler Sozialversi[...]
/dam/jcr:2e9579bd-bc09-4fea-a327-9cd7e3831be2/HSLU_Logo_DE_Schwarz.jpg
CAS Data Protection & Technology