Text Classification
PyTorch
Safetensors
English
eurovoc
Inference Endpoints
scampion commited on
Commit
4d8049f
·
1 Parent(s): 6d15c3f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +67 -5
README.md CHANGED
@@ -28,28 +28,90 @@ widget:
28
 
29
  ---
30
 
31
- # Eurovoc Multilabel Classifer
32
 
33
- [EuroVoc](https://op.europa.eu/fr/web/eu-vocabularies) is a large multidisciplinary multilingual hierarchical thesaurus of more than 7000 classes covering the activities of EU institutions.
34
  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.
35
 
36
  This model based on BERT Deep Neural Network was trained on more than 3, 200,000 documents to achieve that task and is used in a production environment via the huggingface inference endpoint.
37
  This model support the 24 languages of the European Union.
38
 
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  ## Architecture
41
 
42
  ![architecture](architecture.png)
43
 
44
- This classification model is build on top of [EUBERT](https://huggingface.co/EuropeanParliament/EUBERT) with 7331 Eurovoc labels
 
 
 
 
45
 
46
- ## Usage
47
 
48
  ```python
49
  from eurovoc import EurovocTagger
50
  model = EurovocTagger.from_pretrained("EuropeanParliament/eurovoc_eu")
51
  ```
52
-
53
  ## Metrics
54
 
55
 
 
28
 
29
  ---
30
 
31
+ # Eurovoc Multilabel Classifer 🇪🇺
32
 
33
+ [EuroVoc](https://op.europa.eu/fr/web/eu-vocabularies) is a large multidisciplinary multilingual (24 languages of 🇪🇺) hierarchical thesaurus of more than 7000 classes covering the activities of EU institutions.
34
  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.
35
 
36
  This model based on BERT Deep Neural Network was trained on more than 3, 200,000 documents to achieve that task and is used in a production environment via the huggingface inference endpoint.
37
  This model support the 24 languages of the European Union.
38
 
39
 
40
+ ## Examples
41
+
42
+ In English 🇬🇧 :
43
+
44
+ ```
45
+ text = "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."
46
+
47
+ human rights 0.9992846846580505
48
+ religious discrimination 0.8896209001541138
49
+ Burma/Myanmar 0.8654656410217285
50
+ EU relations 0.48358115553855896
51
+ sexual discrimination 0.3569115102291107
52
+ Christianity 0.2744523584842682
53
+ freedom of religious beliefs 0.21020834147930145
54
+ protection of minorities 0.11292753368616104
55
+ ```
56
+
57
+ In French 🇫🇷:
58
+
59
+ ```
60
+ text = "En juillet 2023, la Commission a présenté un paquet de propositions pour l'écologisation du transport de marchandises. Parmi les trois propositions, l'une porte sur l'amélioration de l'utilisation des capacités de l'infrastructure ferroviaire. Le texte proposé comprend des modifications des règles relatives à la planification et à la répartition des capacités d'infrastructure ferroviaire, actuellement couvertes par la directive 2012/34/UE et le règlement (UE) n° 913/2010. L'objectif de ces modifications est de permettre une gestion plus efficace des capacités de l'infrastructure ferroviaire et du trafic, afin d'améliorer la qualité des services et d'optimiser l'utilisation du réseau ferroviaire, d'accueillir des volumes de trafic plus importants et de veiller à ce que le secteur des transports contribue à la décarbonisation."
61
+
62
+ transport infrastructure 0.998161256313324
63
+ rail network 0.9951391220092773
64
+ common transport policy 0.9791265726089478
65
+ transport market 0.9368429780006409
66
+ trans-European network 0.9098047614097595
67
+ high-speed transport 0.4887568950653076
68
+ carriage of goods 0.4874659776687622
69
+ ```
70
+
71
+ In German 🇩🇪:
72
+
73
+ ```
74
+ text = "Am 14. September 2022 schlug die Kommission eine Verordnung zum Verbot von Produkten, die unter Einsatz von Zwangsarbeit, einschließlich Kinderarbeit, hergestellt wurden, auf dem Binnenmarkt der Europäischen Union (EU) vor. Der Vorschlag bezieht sich auf alle Produkte, die auf dem EU-Markt angeboten werden, unabhängig davon, ob sie in der EU für den Inlandsverbrauch oder für die Ausfuhr hergestellt oder eingeführt werden. Er gilt für Produkte aller Art, einschließlich ihrer Bestandteile, aus allen Sektoren und Branchen. Die EU-Mitgliedstaaten wären für die Durchsetzung der Bestimmungen zuständig, und ihre nationalen Behörden könnten Produkte, die unter Einsatz von Zwangsarbeit hergestellt wurden, vom EU-Markt nehmen. Die Zollbehörden würden solche Produkte an den EU-Grenzen identifizieren und aufhalten. "
75
+
76
+ goods and services 0.9618138670921326
77
+ single market 0.9268659949302673
78
+ market approval 0.6425430774688721
79
+ export restriction 0.5231644511222839
80
+ EU Member State 0.4724983870983124
81
+ free movement of goods 0.38777536153793335
82
+ electronic commerce 0.31897953152656555
83
+ ```
84
+
85
+ In Bulgarian 🇧🇬:
86
+
87
+ ```
88
+ text = "В тази кратка бележка се обобщава проучването, в което се оценяват предизвикателствата, възможностите и средносрочните перспективи пред млечния сектор в ЕС в светлината на премахването на квотите за мляко. Проучването се фокусира върху структурните промени в сектора, динамиката на пазара на млечни продукти, необходимостта от екологична устойчивост и устойчивостта на селските райони. Разгледани са и специфичните проблеми на млечните региони в неравностойно положение. Докладът предлага политически препоръки за разглеждане от Европейския парламент с цел ефективно под��омагане на млечното животновъдство и поддържане на селските общности, като същевременно се отговори на изискванията за устойчивост на сектора."
89
+
90
+ reform of the CAP 0.38253700733184814
91
+ milk 0.35211247205734253
92
+ milk product 0.2761436402797699
93
+ agricultural quota 0.24940797686576843
94
+ dairy production 0.2132476419210434
95
+ EU Member State 0.09408465027809143
96
+ ```
97
+
98
+
99
  ## Architecture
100
 
101
  ![architecture](architecture.png)
102
 
103
+ This classification model is built on top of [EUBERT](https://huggingface.co/EuropeanParliament/EUBERT) with 7331 Eurovoc labels
104
+
105
+ With less than 100 million parameters, it can be deployed on commodity hardware without GPU acceleration (around 200 ms per inference for 2000 characters).
106
+
107
+ ## Usage
108
 
 
109
 
110
  ```python
111
  from eurovoc import EurovocTagger
112
  model = EurovocTagger.from_pretrained("EuropeanParliament/eurovoc_eu")
113
  ```
114
+ see the source code also
115
  ## Metrics
116
 
117