Elamur Research

Multi-granular Legal Topic Classification on Greek Legislation

Paper · 2021 · Christos Papaloukas, Ilias Chalkidis, Konstantinos Athinaios et al.

Summary

A legislative index gives readers a way to find laws by the matters they govern. A heading such as labour law covers a large collection of material. Someone looking for rules on holiday allowance needs a much narrower entry. The authors investigate whether a classifier can place a Greek legislative record at either level of detail, or at the intermediate level of the index. To make that question testable, they release Greek Legal Code, called GLC, with 47,563 records derived from a Greek legislative catalogue. The catalogue supplies the expected volume, chapter and subject for each retained record.

The study treats each level as a separate text classification task. In each task, the classifier reads the available text and chooses a single topic from the corresponding part of the index. Some entries contain little more than a heading or short description. Others include legislative articles or the complete text. The candidate set grows to 2285 categories at the subject level, where training examples are scarce for many topics. The authors compare classifiers built from weighted term features, recurrent networks that combine evidence across the words of a record, and pretrained encoders adapted to the task.

GREEK-LEGAL-BERT, an encoder pretrained on Greek legal material, records the best overall test micro-F1 at every level. It scores 89.4 on volumes, 84.3 on chapters and 81.2 on subjects. BIGRU-ATT, a recurrent classifier that learns which word representations deserve greater weight, reaches 86.4 on volumes and 74.8 on subjects. It outperforms a related recurrent classifier that learns separate attention weights for each category. The support vector machine built from weighted terms gives a strong broad-topic result of 85.3 on volumes, then scores 37.9 on subjects. All these figures are overall test micro-F1 for the respective level.

Performance on categories with little training data changes the comparison. GREEK-LEGAL-BERT scores 71.4 test micro-F1 on few-shot subjects, and BIGRU-ATT reaches 66.3, ahead of the multilingual encoders on that group. For few-shot chapters, the general-purpose GREEK-BERT and the legal encoder share the best reported test micro-F1 of 57.8. The authors give no separate scores for categories absent from training. The benchmark shows how the methods fare as the index demands more specific decisions and training support becomes uneven. The effects of using the hierarchy during prediction and of learning to recognize categories with no training examples remain open.

Deep dive: Multi-granular Legal Topic Classification on Greek Legislation

Greek Legal Code tests how well classifiers assign broad and specific topics to Greek legislation, including subjects with little training data. · about 35 minutes to read

The problem and its context

What a catalogue assignment means

Consider the path a reader takes to locate holiday allowance in the catalogue. Labour law is the volume. Collective employment contracts is a chapter within it. Holiday allowance is one of the subjects in that chapter, alongside entries concerning matters such as salary limits. The volume assignment says something meaningful about the document. The subject assignment says considerably more about where a reader should look for it. The classification problem changes with the destination in the index.

A similar structure applies to criminal law. The catalogue distinguishes international criminal law from military criminal law at the chapter level. Subjects under the international chapter include genocide and counterfeiting. The military chapter includes subjects for the military criminal code and legal remedies. These examples show how the intended answer depends on the part of the catalogue being populated. A heading can define a whole branch, a subdivision of that branch, or a destination for individual records.

The study asks whether the text of a record gives a classifier enough evidence to recover its assigned destination. The catalogue provides a known answer, so an automated prediction can be checked against a pre-existing index. This is a particular interpretation of legal topic identification. The subject boundaries come from the organization of the original collection. A successful prediction uses those boundaries closely enough to reproduce the assignment for a document the classifier encounters at evaluation time.

The practical setting is the work of organizing and reviewing large amounts of legal material. The authors describe practitioners facing collections that require substantial effort to examine. Organizing material by topic is one application within a broader line of work that also includes extracting legal entities and obligations, studying court opinions and predicting judgments. Each application defines a different output. For the Greek study, the output is a position in a thematic classification, and the reason to predict it is the role such positions play in helping readers locate relevant legislation. Legal AI

One precedent in the paper’s account is early classification of legislation from EUR-LEX. The documents had EUROVOC concepts attached to them. Several concepts could apply to the same document, and earlier systems used perceptrons, which learn weighted decisions from examples, to predict the labels. A bag of words supplied the input. The approach made it possible to test whether patterns in the vocabulary corresponded to the assigned concepts. It also framed a large set of legal categories as a practical prediction problem.

The difference between a concept assignment in that work and an index placement in GLC matters for the methods. A multi-label classifier can return several applicable labels for a document. In the Greek study, the answer at a given level is a single category. Even though a retained GLC record has a volume, chapter and subject, those are answers to separate tasks. A recurrent design developed to find evidence for several labels can therefore face a different scoring problem when its outputs must compete for one place.

The paper also discusses earlier experiments on 5.5k US court docket entries. That work emphasized the importance of deciding which features to supply to a classifier and found limitations in relying on a bag of words for specialized legal material. A term can be useful evidence of a topic, yet the function it serves within a passage can depend on what surrounds it. A representation built from occurrences of terms captures some of this information, especially if it includes short sequences. The paper uses term-based methods as serious comparisons because the usefulness of simple lexical evidence is an empirical question at each level.

A study of US Supreme Court opinions offered a closer precedent for comparing broad and fine categories. It worked with 8k opinions, with 15 categories in its broad task and 279 in the finer task. Its strongest reported combination paired Word2Vec with a convolutional network, which extracts patterns from local stretches of a sequence. The combination obtained 72.4% accuracy on the broad task and 31.9% on the fine task. The authors of that study proposed exploring recurrent architectures with legal word representations. For GLC, the comparison illustrates why the difficulty of a legal classification task needs to be described at the same granularity as its target.

Another precedent, EURLEX57k, brought the question back to legislation. It contains 57k English-language legislative documents and uses a multi-label setup. As the Greek paper describes it, recurrent encoders with shared attention performed better there than convolutional designs using label-wise attention. The earlier study also found benefits from representations learned on legal text and from embeddings that reflect the surrounding words. A pretrained BERT encoder obtained the strongest results in that comparison. The Greek authors take recurrent architectures and pretrained encoders from this line of work into a different language and a single-choice evaluation. Deep Contextualized Word Representations and BERT

Large label sets and limited resources

The related work includes an extended comparison of systems for large multi-label tasks. Alongside recurrent networks with label-wise attention, it considered probabilistic label trees and pretrained Transformer encoders. A label tree organizes the prediction problem around groups of categories, so traversing the tree narrows the possible answers. As the Greek paper recounts it, the tree-based methods outperformed the recurrent label-wise systems in that comparison, and pretrained encoders improved the best known results on some of the datasets. Combining BERT with label-wise attention yielded the strongest overall results there. The earlier study also examined how category relationships could help with labels having little or no training support.

The GLC authors take from that work a set of comparisons worth revisiting. In particular, they can ask whether category-specific attention still helps when the classification head has to settle on one answer. They also broaden the choice of pretrained encoders to compare Greek-only and multilingual alternatives. Their experiments use the label tree to define the prediction tasks and the size of each candidate set. The question of how to use its branches as part of the prediction procedure is left for further study.

The paper locates this work in a field then concentrated mainly on English and Chinese. Its examples of Greek-language research include sentiment analysis and the identification of offensive language. It also points to prior work on named entities in Greek legislation, which supplied legal word representations the authors could reuse. They describe Greek legal topic classification as an area with little prior work and present their contribution as an open comparison spanning several kinds of classifiers. Offensive Language Identification in Greek

Limited resources take a particular form in a thematic index. The catalogue can contain enough examples to represent every general area while leaving many specific matters sparsely documented in the training set. This makes the collection valuable for asking how an architecture behaves under uneven support. It also means that the choice of language and the choice of taxonomy bring different issues into the same experiment. Pretraining offers one source of information about Greek text, while the catalogue supplies the labelled cases from which a classifier can learn its boundaries.

The method, step by step

Recover the index and the legislative records

The Raptarchis catalogue brings together Greek legislation from 1834 to 2015. It contains material drawn from the Official Government Gazette, including laws, decrees issued by monarchs and presidents, regulations, and decisions. The authors obtained the catalogue in Word format as made available through e-Themis. The files represent legislative volumes, with headings that divide the contents into chapters and subjects. Preparing examples for classification required turning those volumes into individual records while preserving each item's route through the index.

The original files contain formatting and layout variation. Columns are common, but the files can contain single-column material as well as images and scans. The authors used docx2txt to extract the text. Once layout information was gone, the text still needed repairs before headings could reliably serve as boundaries. A missing or misspelled subject marker could obscure a division. A subject identifier could appear on the same line as its heading even where the parser would expect to handle them separately. Irregular line breaks, whitespace and damaged characters also needed attention.

The curation rules use regular expressions and other heuristics to bring the text into a more consistent form. A Python parser then builds a tree of depth 4. The volume nodes contain chapters, the chapter nodes contain subjects, and the subject nodes contain individual legislative items. This organization serves a practical purpose during extraction. Whenever the parser identifies a new item, the enclosing nodes tell it which category text to associate with that item at each level.

The same procedure recovers identifying information from a resource’s metadata. Fields include the title, year of publication, document type and identifier. If the body has discernible article boundaries, the parser separates the articles. Otherwise it preserves the body as a single block. The final document content includes the header and the available body. Article boundaries help represent the structure of the resources in the released data, while the classification target remains the legislative record as a whole.

Resolve repeated entries and seek fuller texts

A document can occur in more than one part of the catalogue. Different provisions in a law may, for example, lead it to be indexed under different subjects. The parser checks for repeated items by pairing the document type and publication year with its identifier. This combination is meant to identify the resource regardless of where it appears in the catalogue. When the same item occurs repeatedly, the authors exclude the resource entirely. That leaves a collection suited to an evaluation in which each record has a single expected assignment at the selected level.

Some of the original entries have only a title or a brief description. The authors use Nomothesia, a Greek legislation platform that offers linked data, to obtain fuller text for eligible document types. The identifying fields recovered during curation are also the fields needed for this lookup. When Nomothesia supplies a text, the parser compares its token count with that of the catalogue text and retains the longer version. The procedure can add substantive provisions to a record without changing its thematic placement.

The resulting collection still varies considerably in how much text is available for a given item. A retained record might carry its original title, selected articles or a full text. A longer version is used where the lookup supplies one, and the curation procedure can preserve article divisions where they are recognizable. The authors give an example in which Nomothesia provides articles for a final JSON record. They also illustrate a short item with wording that conveys its topic densely. Both kinds of records belong to the benchmark.

The authors release GLC as individual JSON resources with their metadata and thematic assignments. They also release the experimental code. The collection and the code serve different roles in reproducing the comparison. The data preserve the document boundaries and labels recovered from the catalogue. The code accompanies the training and evaluation procedures applied to those records.

From legislative volumes to evaluated topic assignments

The steps in order.

From legislative volumes to evaluated topic assignmentsStep 1: Convert catalogue files and repair structural markers1. Convert catalogue files and repair structural markersStep 2: Parse headings, metadata and record boundaries2. Parse headings, metadata and record boundariesStep 3: Exclude duplicates and retrieve fuller texts3. Exclude duplicates and retrieve fuller textsStep 4: Split the curated records4. Split the curated recordsStep 5: Choose the target level of the index5. Choose the target level of the indexStep 6: Train and select classifiers6. Train and select classifiersStep 7: Score predictions on held-out records7. Score predictions on held-out records

Define the prediction before choosing the architecture

The catalogue has 47 volumes, 389 chapters and 2285 subjects. To set up a task, the authors select one level and use the label at that level as the answer for each record. A volume prediction chooses among broad legal areas. A chapter prediction ranges across chapters in the full index. A subject prediction ranges across the most specific entries. The finer tasks are framed as direct choices among their candidates, without conditioning a candidate list on an earlier prediction for the same document.

The authors assign records to training, development and test subsets in proportions intended to carry through from the subjects to the collection as a whole. The training subset is where each classifier learns the connection between texts and their assigned topics. The development subset is used to compare training settings and select a system. The test subset is where the selected procedure is evaluated. The effort to preserve the proportions of the catalogue also preserves the challenge of sparsely populated branches.

The authors characterize category support by the number of training documents assigned to a label. Frequent labels have more than 10 training documents and appear in every subset. In the prose definition, few-shot labels have 1 to 10 training documents and are represented in development and test. The corresponding table label uses <10, so the written definition and table shorthand differ at the upper boundary. Zero-shot labels occur in development, test or both and have no examples in training.

In this paper, those terms describe the support of particular labels under the supplied partition. The classifiers evaluated on the few-shot groups are trained on the ordinary classification task. A few-shot group score therefore describes how those classifiers handle cases for which their category was represented by relatively few training examples. The authors discuss specialized few-shot learning as a direction for addressing that condition.

Build a document vector out of terms

The term-based methods start by constructing a vocabulary of recurring expressions from the training data. Those expressions include n-grams, which are sequences of neighboring tokens. A single word can form a feature, and a sequence of words can form another. This lets the representation distinguish an expression from its individual components when it appears frequently enough to be retained. Each record is then represented by its values for the selected features.

The authors weight those features with TF-IDF. The term frequency part reflects the occurrence of an expression within a document. The inverse document frequency part adjusts for how widespread the expression is in the collection. A recurring legal expression that distinguishes a class can consequently supply useful evidence even if it occupies only a small part of the document. The feature vector records weighted occurrences, with local order encoded inside any expression spanning several tokens.

SVM-BOW uses a support vector machine to separate categories in this feature space. The training search considers a linear kernel and a radial basis function kernel, as well as settings for the penalty on classification errors. A kernel determines the relationships between feature vectors available to the classifier when it builds a decision boundary. The authors also consider n-gram ranges of (1,3) and (1,5) and feature limits of 200k and 400k for this baseline. The representation can therefore include a substantial inventory of word sequences alongside individual words.

XGBOOST-BOW also receives TF-IDF-weighted bag-of-words features. Here the classifier consists of boosted decision trees. Each tree uses feature tests to direct an example toward a score, and the boosting procedure adds trees with the aim of reducing the loss of the sequence built so far. The authors give a setting of 800 estimators, search over limits on tree depth and vary the minimum child weight, which affects whether branches can be split with limited evidence. They use a softmax objective for the choice among categories. Comparing the two baselines puts different decision procedures on the same general kind of lexical representation. XGBoost

Encode words in their surrounding text

For the recurrent family, a word starts as a vector learned in advance by Word2Vec. The vectors come from Greek legal corpora that include national and EU legislation. These word embeddings provide reusable numerical representations before the network learns any of the GLC labels. The paper denotes the starting vector at position i by wᵢ.

The encoder passes the sequence through bidirectional gated recurrent units, abbreviated BiGRUs. A recurrent unit processes words in order and maintains a state reflecting what it has read. Its gates regulate what information to retain and what to update. A bidirectional encoder processes the sequence in both directions, so its representation at a position can use material from before and after that word. The paper denotes the resulting contextual vector at i by hᵢ. These vectors form a sequence with one representation for each word position.

All the recurrent variants need a way to reduce that sequence to a form suitable for assigning a topic. BIGRU-MAX uses max pooling. It looks separately at each vector component and retains the highest value for that component across positions. The document vector can assemble strong activations from different places in the text. An output layer uses the pooled information to produce one score per category. Softmax converts the scores into a probability distribution across the available answers.

Learn weights shared by the categories

BIGRU-ATT uses attention to combine the contextual vectors. The idea is to give some positions more influence on the final representation than others. It learns a vector that measures the relevance of a contextual word vector through a dot product. The resulting scores are exponentiated and normalized together, giving a set of positive weights over the document’s positions.

aᵢ = exp(hᵢᵀu) / Σⱼ exp(hⱼᵀu)

The symbol aᵢ is the attention weight at position i, and hᵢ is the contextual word vector there. The vector u is learned during classification training and shared across categories. The raised ᵀ denotes a transpose, allowing the product with u to be read as a dot product. The function exp applies the exponential to the score. In the denominator, Σⱼ adds the exponentiated scores for every position j, whose vectors are written hⱼ. The slash indicates division by that total, and the equality defines the weight for the position under consideration.

That denominator is common to all positions in a document. A strong match to the learned vector consequently raises a position’s contribution relative to other positions in that same record. Since the input to this comparison is contextual, even occurrences of the same word can receive different weights. The attention layer then aggregates the contextual vectors with those weights. The paper includes a length factor outside the sum.

d = (1/T) Σᵢ₌₁ᵀ aᵢ hᵢ

The symbol d is the document vector. T is the length in words, and 1/T scales the sum by the reciprocal of that length. The sum Σᵢ₌₁ᵀ proceeds from the first position through the final position T. At each position i, the scalar aᵢ multiplies the whole contextual vector hᵢ. The equality defines the document representation used by the output layer. The upper-case T used for length here is distinct from the raised transpose marker in the weight calculation.

The output layer receives a single d regardless of the category it is scoring. It learns how features of that representation support different categories, and a softmax over the scores supplies the probabilities. The shared attention vector learns how to collect evidence for the task as a whole. The final scoring layer learns what that evidence indicates about individual topics. The paper relates this style of attention to earlier work that used weighted representations for prediction. Show, Attend and Tell

Learn a separate set of weights for each category

BIGRU-LWAN, the label-wise version, can assemble different views of the same record. One category might depend on language in a particular provision, while another might depend more heavily on an expression elsewhere in the text. The architecture assigns each category its own learned attention vector, so these distinctions can enter as soon as the network aggregates the word representations. The underlying BiGRU supplies the same sequence to all the category heads. The design has a precedent in prediction of medical codes, where label-wise attention was originally combined with a convolutional encoder. Explainable Prediction of Medical Codes from Clinical Text

aₗᵢ = exp(hᵢᵀuₗ) / Σⱼ exp(hⱼᵀuₗ)

The label index l identifies the category, and position i identifies the word whose contribution is being calculated. The weight aₗᵢ pertains to that category and position. The contextual position vector is hᵢ, and uₗ is the learned attention vector belonging to category l. The superscript ᵀ marks the transpose used for the dot product, and exp exponentiates the product. The denominator Σⱼ adds equivalent scores for all positions j, using their vectors hⱼ and keeping uₗ fixed. Division by that denominator normalizes positions within the category’s head, and the equality assigns the resulting weight.

dₗ = (1/T) Σᵢ₌₁ᵀ aₗᵢ hᵢ

Here dₗ is the document representation for category l. T counts the words in the document, 1/T is the reciprocal length factor, and Σᵢ₌₁ᵀ adds contributions from position i equal to the first position through T. The contextual vector hᵢ is scaled by the category’s position weight aₗᵢ before summation. The equality specifies the resulting category-specific vector.

There are L heads, where L is the number of labels at the level being studied. Each head has its own dense scoring layer that produces a score from its representation. Softmax combines these scores into one distribution over the L candidates. Label-wise attention therefore changes the information presented to each category scorer while retaining the single-choice output used by the other recurrent variants. This creates a direct comparison of approaches that differ in when category specificity enters the prediction.

Adapt pretrained encoders with different backgrounds

The final family starts with pretrained Transformer encoders. BERT pretraining allows representations to depend on wording to the left and right of a position. For the classification task, the encoder has a special classification position. Its final vector acts as the record representation, and a linear layer reads that vector to give each topic a score. Softmax converts those scores to probabilities. Training with the GLC labels adapts the pretrained encoder and the task-specific output layer in the process known as fine-tuning.

M-BERT is the multilingual cased BERT-base variant. The paper describes it as supporting modern Greek alongside 99 other languages. XLM-RoBERTa is also multilingual, with support for 100 languages including Greek. Its pretraining uses 2.5TB of filtered Common Crawl text. Its design follows RoBERTa, whose training changes include dropping the next-sentence objective and using larger batches and a higher learning rate than the earlier procedure described for BERT. The Greek classification experiments give these systems an opportunity to transfer multilingual pretraining to a task carried out in Greek. RoBERTa and Unsupervised Cross-lingual Representation Learning at Scale

GREEK-BERT provides a general-purpose counterpart focused on modern Greek. Its pretraining uses 29GB of text drawn from Greek Wikipedia, the Greek portion of Europarl and OSCAR. GREEK-LEGAL-BERT narrows the domain to Greek legal text. Its corpus contains around 5GB of Greek and EU legislation obtained via Nomothesia. The same kind of classifier is attached to each encoder for the GLC experiments. The BERT family follows the base configuration, which the paper describes as having 12 layers and 12 attention heads per layer.

These systems enter training with different kinds of prior exposure. The multilingual encoders have learned from text across languages, the general Greek encoder starts with sources chosen for Greek, and the Greek legal encoder starts with legislative sources. Fine-tuning gives each system supervised examples of how the Raptarchis index places its documents. The resulting comparison measures how effectively the available encoders adapt to those categories under the paper’s procedure.

Select settings on the development split

For most methods, the authors search a grid of core hyper-parameters. These are settings chosen before training, such as kernel type or learning rate. For the recurrent variants, they use HyperOpt to explore a larger space. Their choices include recurrent depth, the number of units, dropout, word dropout and batch size. Dropout temporarily withholds parts of the network’s input or internal representation during training. Word dropout applies this idea at the word input level. The batch size is the amount of training data processed for an update.

For the pretrained encoders, the authors specify dropout of 0.1 and a batch size of 8. They consider learning rates of 1e-5, 2e-5, 3e-5 and 5e-5. The learning rate governs the size of parameter updates. The paper describes neural training with early stopping based on development loss, using Adam to adjust the parameters. Early stopping uses the development data to guide when to stop learning, while the test results are reserved for the selected procedure. Each method’s test scores are averages over 5 runs with different seeds. Adam

Experiments and results

The distribution of records and labels

The partition assigns 60% of GLC to training and 20% each to development and test. The paper lists 28,536 training documents, 9511 development documents and 9516 test documents. Their respective mean lengths are 600, 574 and 595 tokens. For the full dataset, the mean is 594 tokens, and 54% of records have fewer than 100 tokens. The mean and the share of short records describe different features of the input. Lengthy records can raise the average even when short records make up a large part of what a classifier encounters.

Every volume has enough training examples to count as frequent. The distribution changes at the chapter level. Of the 389 chapter labels, 333 are frequent, 53 are few-shot and 3 are zero-shot. The full corpus has 47,108 documents under frequent chapter labels, accounting for 99.0% of records. The few-shot chapter group contains 445 documents across all splits. A classifier’s overall chapter score can thus be driven strongly by how it handles frequent labels.

At the subject level, 712 categories are frequent, 1431 are few-shot and 142 are zero-shot. The frequent subjects account for 38,475 documents across all splits, or 80.9% of the collection. The few-shot subjects account for 8870 documents, or 18.6%. The zero-shot subjects have 218 records outside training. These figures concern the composition of GLC. The test scores describe performance on its held-out partition.

The evidence available to a classifier depends on how many records a category contributes and how much text those records contain. In the frequency analysis, a short record counts as one training case, as does an entry with several articles. The resulting groups answer a specific question about the number of labelled examples. They leave the amount and character of the text within those examples to vary as they do in the collection.

How to read precision, recall and F1

The authors report test precision, recall and F1. For a group of categories, precision asks how often predictions into the group assign the correct category. Recall asks how frequently examples whose expected category is in the group receive that category. An incorrect prediction of another label within the group still counts as a classification error. F1 combines precision and recall through their harmonic mean and is sensitive to a low value on either measure.

All reported scores are micro-averaged. This means that counts used to calculate precision and recall are pooled across the relevant labels. Categories with many test records can consequently contribute more to the overall measure than sparsely represented categories. The frequent and few-shot columns restrict the range of labels whose performance is being examined and give a view of results that a single pooled figure cannot supply.

Each test record calls for one label, and each classifier gives one answer. In the all-label results, the paper reports identical precision, recall and F1 at a given level for each method. The frequency groups can give different values for those measures. A document from a few-shot subject that receives a frequent subject label adds a missed case to the few-shot calculation and an incorrect prediction to the frequent calculation. The paper reports the few-shot groups where they occur and omits a dedicated breakdown for zero-shot labels.

Several classifiers recognize the broad volumes

The volume experiment asks for the broadest placement in the catalogue. Since all 47 categories are frequent, the figures for all labels and frequent labels coincide. GREEK-LEGAL-BERT gives the highest overall test micro-F1 of 89.4, with GREEK-BERT next at 87.5. BIGRU-ATT reaches 86.4 and gives the strongest recurrent result. The multilingual encoders also make competitive broad assignments. M-BERT obtains 85.8, and XLM-RoBERTa obtains 85.0.

Overall test micro-F1 for GLC volume assignments

The Greek legal encoder leads, and the support vector baseline is competitive with several contextual encoders.

Overall test micro-F1 for GLC volume assignmentsGREEK-LEGAL-BERT (this paper): 89.4GREEK-LEGAL-BERT (this paper)89.4GREEK-BERT: 87.5GREEK-BERT87.5BIGRU-ATT: 86.4BIGRU-ATT86.4M-BERT: 85.8M-BERT85.8SVM-BOW: 85.3SVM-BOW85.3XLM-ROBERTA: 85.0XLM-ROBERTA85.0BIGRU-MAX: 84.3BIGRU-MAX84.3BIGRU-LWAN: 84.1BIGRU-LWAN84.1XGBOOST-BOW: 77.2XGBOOST-BOW77.2
The numbers
System or settingmicro-F1
GREEK-LEGAL-BERT (this paper)89.4
GREEK-BERT87.5
BIGRU-ATT86.4
M-BERT85.8
SVM-BOW85.3
XLM-ROBERTA85.0
BIGRU-MAX84.3
BIGRU-LWAN84.1
XGBOOST-BOW77.2

The strong support vector result shows how far weighted terms can take this task. Its test micro-F1 of 85.3 exceeds the scores of the recurrent systems that use max pooling or label-wise attention. The volume decision is therefore within reach of methods with substantially different ways of representing text. Legal terms and phrases selected from the training corpus provide enough evidence for a strong result from the support vector classifier.

The boosted-tree baseline reports 77.2 on the same overall test metric. It shares the general representation strategy of SVM-BOW, yet the scores show that performance depends on what the classifier learns to do with those features. The study reports a predictive comparison. The authors characterize XGBOOST-BOW as fast to train, with the figures in the table describing its classification result.

The monolingual encoders lead on the volume task, and the ordering of the multilingual systems also gives a useful reference for reading the finer tasks. M-BERT finishes above XLM-RoBERTa on volumes. The ordering reverses on chapters and subjects. The particular granularity of the answer matters even among encoders that share the broad strategy of multilingual pretraining.

The chapter results show why recall matters for rare labels

At the chapter level, GREEK-LEGAL-BERT records 84.3 overall test micro-F1, followed by GREEK-BERT at 82.4. BIGRU-ATT scores 81.1. It is above both multilingual encoders on this pooled metric, with XLM-RoBERTa at 80.6 and M-BERT at 80.2. This is the clearest overall result in which the recurrent architecture with shared attention moves ahead of both multilingual choices.

Among the remaining recurrent variants, BIGRU-MAX has 77.5 overall test micro-F1 and BIGRU-LWAN has 76.8. SVM-BOW comes in at 77.9, and XGBOOST-BOW reports 67.5. The overall scores principally reflect frequent chapters, consistent with the small share of documents belonging to few-shot chapters. For example, the frequent-chapter F1 of GREEK-LEGAL-BERT is 84.6, while its few-shot result has a different precision and recall profile.

The support vector baseline makes the importance of that breakdown particularly visible. For few-shot chapters, its test precision is 90.0, recall is 09.3, and F1 is 16.8. The predictions it does assign to that part of the catalogue are frequently correct. They cover a limited fraction of the expected assignments. From the reader’s standpoint, a high precision number alone would say little about how often records belonging to these chapters get placed there.

The boosted-tree classifier reaches 13.4 test F1 for few-shot chapters, with 19.2 precision and 10.3 recall. Here the low F1 accompanies low performance on both measures, while the support vector machine’s F1 reflects a very uneven pair of values. Looking at which component is low explains more about the result than treating the figures for the two term-based baselines as evidence of an identical pattern of errors.

Among the recurrent classifiers, BIGRU-MAX obtains 45.1 test F1 for few-shot chapters and BIGRU-ATT obtains 54.9. BIGRU-LWAN gives 41.7. On the same group, M-BERT obtains 56.6 and XLM-RoBERTa obtains 51.3. Thus BIGRU-ATT’s chapter-wide lead over both multilingual encoders narrows to a lead over XLM-RoBERTa when the evaluation is restricted to few-shot chapters.

Both Greek encoders report 57.8 few-shot chapter F1. GREEK-BERT has precision of 81.0 and recall of 45.2. GREEK-LEGAL-BERT has precision of 79.0 and recall of 45.8. The equality of the reported F1 values describes the balance of these measures at the displayed resolution. The general Greek encoder is more precise on this group, and the legal encoder recovers more of its assignments. The latter’s advantage on the full chapter task does not carry over to a higher reported F1 on these labels.

The subject task separates the methods more sharply

The subject task spans the most candidates and contains the strongest imbalance in label support. GREEK-LEGAL-BERT records 81.2 overall test micro-F1 and GREEK-BERT reaches 79.4. The multilingual encoders also lead the recurrent systems in the overall comparison here. XLM-RoBERTa scores 78.0, and M-BERT scores 76.8.

Overall test micro-F1 for GLC subject assignments

The Greek legal encoder gives the strongest fine-grained performance, with recurrent and term-based systems farther behind.

Overall test micro-F1 for GLC subject assignmentsGREEK-LEGAL-BERT (this paper): 81.2GREEK-LEGAL-BERT (this paper)81.2GREEK-BERT: 79.4GREEK-BERT79.4XLM-ROBERTA: 78.0XLM-ROBERTA78.0M-BERT: 76.8M-BERT76.8BIGRU-ATT: 74.8BIGRU-ATT74.8BIGRU-LWAN: 65.2BIGRU-LWAN65.2BIGRU-MAX: 62.9BIGRU-MAX62.9XGBOOST-BOW: 55.3XGBOOST-BOW55.3SVM-BOW: 37.9SVM-BOW37.9
The numbers
System or settingmicro-F1
GREEK-LEGAL-BERT (this paper)81.2
GREEK-BERT79.4
XLM-ROBERTA78.0
M-BERT76.8
BIGRU-ATT74.8
BIGRU-LWAN65.2
BIGRU-MAX62.9
XGBOOST-BOW55.3
SVM-BOW37.9

BIGRU-ATT retains its lead among the recurrent approaches at 74.8 test micro-F1. BIGRU-LWAN, with category-specific attention, scores 65.2, and the max-pooling variant scores 62.9. The ranking of the latter variants has changed since the volume task, where max pooling was marginally ahead. Shared attention leads the recurrent family at every level, including the fine task in which the subject distinctions give the category-specific architecture many separate selection heads.

The subject scores also reverse the ordering of the weighted-term baselines. SVM-BOW falls to 37.9 overall test micro-F1, placing last. XGBOOST-BOW reaches 55.3. The support vector result on volumes demonstrates that its lexical representation can be effective for broad placement. The subject comparison shows how little the broad ranking predicts the performance of the same approaches on the smallest thematic distinctions.

For frequent subjects, GREEK-LEGAL-BERT records 84.2 test F1, with GREEK-BERT at 82.2. XLM-RoBERTa gives 81.8, and M-BERT gives 81.1. BIGRU-ATT reaches 77.4. These results maintain the order of the leading systems in the overall subject comparison. The nature of the ordering changes once the same systems are evaluated over the few-shot part of the subject index.

Few-shot subjects change the middle of the ranking

GREEK-LEGAL-BERT reaches 71.4 test F1 on few-shot subjects, ahead of GREEK-BERT at 70.6. The legal encoder records 73.6 precision and 69.4 recall on this group. The general Greek encoder has 74.6 precision and 67.0 recall. The legal encoder’s advantage in the group’s F1 comes with the higher recall and the lower precision of the pair.

BIGRU-ATT reaches 66.3 F1 with precision of 72.6 and recall of 61.1. Its F1 on this group exceeds the multilingual results of 65.0 for XLM-RoBERTa and 62.0 for M-BERT. The recurrent system’s precision also exceeds theirs on these labels, while their recall figures are 62.1 and 59.7 respectively. The few-shot ranking thus reflects a different balance of recovered assignments and incorrect predictions than the overall ranking across subjects.

Test micro-F1 for few-shot subjects in GLC

Shared recurrent attention ranks ahead of both multilingual encoders on sparsely supported subjects.

Test micro-F1 for few-shot subjects in GLCGREEK-LEGAL-BERT (this paper): 71.4GREEK-LEGAL-BERT (this paper)71.4GREEK-BERT: 70.6GREEK-BERT70.6BIGRU-ATT: 66.3BIGRU-ATT66.3XLM-ROBERTA: 65.0XLM-ROBERTA65.0M-BERT: 62.0M-BERT62.0BIGRU-LWAN: 45.0BIGRU-LWAN45.0BIGRU-MAX: 42.0BIGRU-MAX42.0XGBOOST-BOW: 27.2XGBOOST-BOW27.2SVM-BOW: 00.0SVM-BOW00.0
The numbers
System or settingmicro-F1
GREEK-LEGAL-BERT (this paper)71.4
GREEK-BERT70.6
BIGRU-ATT66.3
XLM-ROBERTA65.0
M-BERT62.0
BIGRU-LWAN45.0
BIGRU-MAX42.0
XGBOOST-BOW27.2
SVM-BOW00.0

The weaker recurrent variants obtain 45.0 and 42.0 test F1 on few-shot subjects, with the label-wise version again ahead of max pooling in the subject task. XGBOOST-BOW scores 27.2, recording 46.9 precision and 19.1 recall. SVM-BOW has reported precision, recall and F1 of 00.0 for this group. These values go beyond the information conveyed by the support vector machine’s drop in overall performance. They locate a particularly weak part of that baseline’s coverage in the experiment they measure.

The subject breakdown makes clear that having examples for a label, even in the test and development splits as well as training, can still leave a difficult supervised task. It also qualifies any attempt to describe results using only the order of the architecture families. The strongest recurrent system places below the multilingual alternatives on all subjects together and above them for the few-shot group. The Greek-only encoders keep their lead under both views, while the relative strengths of alternatives depend on which portion of the index matters.

What the ablations show

The paper leaves dedicated component ablations to future work and offers comparisons among recurrent designs, pretrained encoders and groups of labels with different training support.

Shared attention versus max pooling

The closest architectural comparison uses the recurrent variants. They begin with legal Word2Vec representations and the same kind of bidirectional encoder. BIGRU-MAX passes the largest activation in each component to the output layer. BIGRU-ATT learns a weighting over contextual word vectors and combines them into one document representation. The systems each go through the tuning procedure, so the results show how their trained versions compare on GLC.

Overall test micro-F1 favors shared attention at every granularity. The chapter figures are 81.1 for BIGRU-ATT and 77.5 for BIGRU-MAX. Their results on few-shot subjects, 66.3 and 42.0 respectively, show a wider separation in that particular evaluation. The shared mechanism can combine evidence from several positions with a learned sense of their importance. Max pooling supplies the strongest value along each dimension, which can discard a pattern of moderate but jointly informative responses in the sequence. The authors suggest that pooling may lose some characteristics important for recognizing the document’s topic.

This comparison supports the choice of shared attention over max pooling within the recurrent systems the authors tried. It also marks a boundary around the explanation. The paper reports differences in predictive performance. It does not check which terms or passages human readers would treat as decisive, or test whether removing a highly weighted position changes the prediction in the expected way. The comparison speaks to the way the complete architectures perform while leaving the relationship between their weights and human legal interpretation unanswered.

Category-specific attention and competition among scores

Label-wise attention offers greater flexibility in how each category gathers evidence. It can build a representation from material a common attention head might give little weight. Its results on GLC show that this flexibility alone is of limited benefit in the tested single-choice setting. BIGRU-ATT leads BIGRU-LWAN on overall test micro-F1 for every level. On few-shot chapters their F1 values are 54.9 and 41.7. On few-shot subjects they are 66.3 and 45.0.

The result also has a qualification within the recurrent family. On subjects, the label-wise system is ahead of max pooling on both overall and few-shot F1. That gives evidence of a benefit for one attention design over pooling in the fine task, alongside the larger benefit for shared attention. On chapters, max pooling is ahead of label-wise attention on both of those evaluations. The comparison therefore distinguishes the recurrent aggregation procedures by granularity and by training support.

The authors speculate that category-specific attention can produce strong individual scores that then compete poorly under one softmax. Every head can assemble the parts of the document most favorable to its own score. A multi-label prediction problem can use several such scores to accept several labels. GLC asks the head scores to settle a single choice. The proposed explanation concerns this interaction of scoring and normalization. Changing the prediction objective while holding the attention design fixed was outside the experiments, so the competing-score account remains a hypothesis.

Training support offers another way of reading the architectural difference. In the shared design the same attention parameters apply across the label space. In the label-wise design every category has its own attention vector, although all categories use the common recurrent encoder. Few-shot results tell us how these arrangements work with the observed label counts. Establishing what share of their difference arises from the data available to the individual heads would require varying support for otherwise comparable categories.

The pretrained comparisons include several changes at once

The two Greek-only encoders have the strongest overall results, and the one pretrained on legal material comes first. The authors suggest that exposure to Greek text and specialization in legal language help explain that ordering. Greek legal pretraining can provide familiarity with the kinds of expressions or distinctions encountered in legislation. The experiment compares available encoders with different pretraining histories, so the combined result includes the effects of differences in their corpora and training setups.

A similar point applies to the recurrent methods. They all use Greek legal embeddings, and the strongest of them proves competitive with multilingual Transformers. This demonstrates what can be achieved with a recurrent classifier equipped with those embeddings. A matched comparison with general-purpose Greek word embeddings would be needed to isolate how much of that strength comes from the legal training corpus. The reported recurrent comparisons identify document aggregation as a part of the architecture associated with substantial variation in performance.

The authors also offer explanations for the relative success of the Transformer encoders on fine categories. They suggest that sub-word units could help with Greek word forms by allowing the representation to use pieces that recur across forms. They also suggest that multiple attention heads could identify details that matter when the choice is among specialized categories. Neither explanation is separately measured. A recurrent variant supplied with pretrained sub-word embeddings is one of the comparisons they propose for future work. Subword tokenization

The frequency analysis tests a different aspect of performance

The frequency breakdown addresses where the supervised methods succeed. At the volume level, every label falls in the frequent group. At the chapter level, cases belonging to few-shot categories have little influence on the pooled score. In the subject task, the group accounts for a greater share of the documents, and its evaluation gives a distinct view of which systems recover sparsely supported labels.

The reported comparisons show changes in rank without establishing why particular labels are hard. The shared recurrent encoder beats both multilingual alternatives on few-shot subjects despite trailing them overall. The Greek legal and general encoders share the highest few-shot chapter F1 even though the legal system leads on all chapters together. Such results depend on the naturally occurring allocation of examples across labels. The analysis establishes where a method’s relative performance changes, while the amount of training data, the lexical distinctiveness of the categories and their document content all remain characteristics of the same cases.

Limitations

Limits identified by the authors

The authors identify uneven label frequencies and scarcity of training examples as problems requiring special handling. The methods they evaluate use supervision from examples assigned to their categories. The paper describes them as incapable of zero-shot learning and gives no dedicated zero-shot result. Label descriptions and the relationships among categories are potential sources of information the authors propose studying for labels with limited or absent training evidence. The classification figures establish what happens under the supervised setup they run.

The authors also leave hierarchy-aware prediction to future work. The dataset preserves a full path for each item, but the prediction tasks ask independently for a volume, chapter or subject. The paper provides no comparison with a classifier that uses a predicted chapter to limit subjects, or one that learns to choose a compatible path jointly. Its results show the difficulty of predicting the categories at each level. An evaluation of how much the tree itself could help remains open. HDLTex

The discussion explicitly calls for further checks of the explanations for the architecture results. The authors propose working with additional datasets and making changes that would isolate aspects such as the input representation. They also note the computational effort involved in building language-specific pretrained encoders and ask whether that effort is always justified when strong multilingual systems are available. Their benchmark compares prediction scores for available systems. It supplies no cost measurements that would establish when training a new encoder is worthwhile.

The paper names Greek-language EU legislation as a possible setting for testing whether the conclusions hold elsewhere. It also suggests Cypriot legislation as a way to examine generalization outside the source domain. The reported results are confined to GLC, where both the legislative material and its assignments come from the curation of a particular catalogue. Transfer to a different collection or taxonomy would be an additional empirical question.

Limits implied by the construction of the tasks

The benchmark’s single-answer structure follows from a curation choice. Resources indexed more than once are removed in their entirety. Consequently the predictions are evaluated on items remaining after repeated placement has been resolved by exclusion. A law that covers several matters through distinct provisions can be especially relevant when readers search by topic, and multiple placements can preserve that relevance. The experiments leave the recovery of such placements outside their scope.

Catalogue agreement is the test criterion. It is possible to measure it against a known answer for each retained record, and the figures show how frequently a system recovers that answer. The paper supplies no independent assessment of how experts would judge borderline assignments or whether a reader could still retrieve a document under a different plausible heading. Those questions concern legal interpretation and search effectiveness, which would require criteria beyond the observed topic labels.

The mixture of short descriptions and more complete legislative texts also limits what a pooled score can establish. In some short entries a few explicit terms can signal the answer. In a longer entry the evidence may be spread among provisions or require distinguishing the main subject from matters mentioned in passing. The paper provides counts and examples that illustrate the mixture. It gives no test breakdown by length, whether the whole original text was present, or whether Nomothesia supplied the version used. The comparison therefore applies to the mix of record types in the partition.

There is also a question about the relationship between pretraining and test content. GREEK-LEGAL-BERT drew its corpus from Nomothesia, and the dataset curation also used Nomothesia to enlarge some records. The paper gives no analysis of shared documents between the pretraining corpus and GLC. The common source motivates a check on the extent and effects of any overlap. It supplies no way to determine them from the reported figures.

Granularity, candidate set size and the distribution of training examples change together in these experiments. The subject score reflects all those conditions. It cannot show how much of the difference from volume performance would persist with equally supported labels or a candidate set of the same size. Similarly, the frequent and few-shot groups consist of different topics. Comparing those groups reveals how well the classifiers handle naturally sparse labels and leaves the independent effect of adding training cases for a fixed topic unmeasured.

Finally, the split is designed around the distribution of labels. The paper gives no time-based evaluation that could show how well a system trained on earlier records handles later legislation. The reported figures are averages from runs with different seeds, and the tables give no measure of run-to-run variation. Close rankings can therefore be interpreted as rankings of displayed averages, with uncertainty about their stability across runs or other partitions.

What came after

LegalBench (2023) cites the Greek classification study in work on a collaboratively built benchmark for legal reasoning. Its stated aim gives the citation a broader evaluation context. GLC defines an answer through placement in a legislative index. A legal-reasoning benchmark organizes evaluation around tests of reasoning ability. The connection is between efforts to define legal tasks precisely enough to assess them through examples. The citation establishes that the Greek work enters that discussion. The specific use of its records or classification levels is undetermined.

LEXTREME (2023) cites the study in the context of a legal benchmark spanning languages and tasks. The Greek paper contributes a concrete instance of what evaluating across tasks can mean within one language. Its documents stay in Greek while the target changes from areas of law to finer entries in the thematic index. LEXTREME’s stated scope brings the task dimension together with variation in language. Its citation connects GLC to that wider multilingual evaluation effort, though the experimental role of individual GLC tasks is unspecified.

Surveying the field and comparing representations

Natural Language Processing for the Legal Domain (2024) cites the Greek study as part of a survey of legal language tasks, datasets, systems and challenges. GLC links those topics in one example. The study defines a supervised task using an existing legislative collection, shows results at different levels of an index, and exposes uneven training support when the index becomes more specific. Those features explain its relevance to a survey concerned with both resources and evaluation challenges. The citation establishes the connection without specifying how much attention the survey gives to each of those aspects.

MMTEB (2025) cites the paper in work on benchmarking text embeddings across languages. Its stated focus on representations connects with a central comparison in GLC. A weighted vocabulary, a contextual recurrent representation and a pretrained classification representation all supply different views of the same legislative record. Their differences become measurable when the classifier has to choose a topic with an established answer. The citation situates that experiment in the broader study of multilingual text representations. Whether GLC supplies any of MMTEB’s evaluation data, or is discussed as related work, remains unspecified.

Cite

Cite as Christos Papaloukas, Ilias Chalkidis, Konstantinos Athinaios, Despina Pantazi and Manolis Koubarakis. 2021. Multi-granular Legal Topic Classification on Greek Legislation. Proceedings of the Natural Legal Language Processing Workshop 2021.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2021.nllp-1.6

@inproceedings{papaloukas2021multi,
  title = {{Multi-granular Legal Topic Classification on Greek Legislation}},
  author = {Christos Papaloukas, Ilias Chalkidis, Konstantinos Athinaios, Despina Pantazi and Manolis Koubarakis},
  booktitle = {Proceedings of the Natural Legal Language Processing Workshop 2021},
  year = {2021},
  doi = {10.18653/v1/2021.nllp-1.6},
  url = {https://doi.org/10.18653/v1/2021.nllp-1.6}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/papaloukas-2021-multi-granular-legal-topic-classification/