Edit model card

Eurovoc Multilabel Classifer

EuroVoc is a large multidisciplinary multilingual hierarchical thesaurus of more than 7000 classes covering the activities of EU institutions. Given the number of legal documents produced every day and the huge mass of pre-existing documents to be classified high quality automated or semi-automated classification methods are most welcome in this domain.

This model based on BERT Deep Neural Network was trained on more than 200,000 documents to achieve that task and is used in a production environment via the huggingface inference endpoint.

Architecture

architecture

7331 Eurovoc labels

Usage

from eurovoc import EurovocTagger
model = EurovocTagger.from_pretrained("EuropeanParliament/eurovoc_en")

Metrics

Eurlex57k Dataset

Metric Value Threshold Value
Micro F1 0.7233 0.34
NDCG@3 0.8438 -
NDCG@5 0.8079 -
NDCG@10 0.833 -

These values are in line with the state of the art in the field, see the publication Large Scale Legal Text Classification Using Transformer Models.

Inference Endpoint

Member of the European Parliament HuggingFace Organisation can access to our inference endpoint.

Payload example

{
  "inputs": "The Union condemns the continuing grave human rights violations by the Myanmar armed forces, including torture, sexual and gender-based violence, the persecution of civil society actors, human rights defenders and journalists, and attacks on the civilian population, including ethnic and religious minorities. ",
  "topk": 10,
  "threshold": 0.16
}

result:

{'results': [{'label': 'international sanctions', 'score': 0.9994925260543823},
             {'label': 'economic sanctions', 'score': 0.9991770386695862},
             {'label': 'natural person', 'score': 0.9591936469078064},
             {'label': 'EU restrictive measure', 'score': 0.8388392329216003},
             {'label': 'legal person', 'score': 0.45630475878715515},
             {'label': 'Burma/Myanmar', 'score': 0.43375277519226074}]}

Only six results, because the following one score is less that 0.16

Default value, topk = 5 and threshold = 0.16

Author(s)

Sébastien Campion [email protected]

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Examples
Unable to determine this model's library. Check the docs .