Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,126 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- el
|
5 |
+
metrics:
|
6 |
+
- f1
|
7 |
+
- recall
|
8 |
+
- precision
|
9 |
+
- hamming_loss
|
10 |
+
pipeline_tag: text-classification
|
11 |
+
widget:
|
12 |
+
- text: >-
|
13 |
+
Δεν ξέρω αν είμαι ο μόνος αλλά πιστεύω πως όσο είμαστε απασχολημένοι με την όλη κατάσταση της αστυνομίας η κυβέρνηση προσπαθεί να καλύψει αλλά γεγονότα της επικαιρότητας όπως πανδημία και εξωτερική πολιτική.
|
14 |
+
example_title: Πολιτική
|
15 |
+
- text: >-
|
16 |
+
Άλλες οικονομίες, όπως η Κίνα, προσπαθούν να διατηρούν την αξία του νομίσματος τους χαμηλά ώστε να καταστήσουν τις εξαγωγές τους πιο ελκυστικές στο εξωτερικό. Γιατί όμως θεωρούμε πως η πτωτική πορεία της Τουρκικής λίρας είναι η "αχίλλειος πτέρνα" της Τουρκίας;
|
17 |
+
example_title: Οικονομία
|
18 |
+
- text: >-
|
19 |
+
Γνωρίζει κανείς γιατί δεν ψηφίζουμε πια για να βγει ποιο τραγούδι θα εκπροσωπήσει την Ελλάδα; Τα τελευταία χρόνια ο κόσμος είναι δυσαρεστημένος με τα τραγούδια που στέλνουν, γιατί συνεχίζεται αυτό;
|
20 |
+
example_title: Ψυχαγωγία/Κουλτούρα
|
21 |
+
model-index:
|
22 |
+
- name: IMISLab/Greek-Reddit-BERT
|
23 |
+
results:
|
24 |
+
- task:
|
25 |
+
type: text-classification
|
26 |
+
name: Text-classification
|
27 |
+
dataset:
|
28 |
+
name: GreekReddit
|
29 |
+
type: greekreddit
|
30 |
+
config: default
|
31 |
+
split: test
|
32 |
+
metrics:
|
33 |
+
- name: Precision
|
34 |
+
type: precision
|
35 |
+
value: 80.05
|
36 |
+
verified: true
|
37 |
+
- name: Recall
|
38 |
+
type: recall
|
39 |
+
value: 81.48
|
40 |
+
verified: true
|
41 |
+
- name: F1
|
42 |
+
type: f1
|
43 |
+
value: 80.61
|
44 |
+
verified: true
|
45 |
+
- name: Hamming Loss
|
46 |
+
type: hamming_loss
|
47 |
+
value: 19.84
|
48 |
+
verified: true
|
49 |
+
datasets:
|
50 |
+
- IMISLab/GreekReddit
|
51 |
+
library_name: transformers
|
52 |
+
tags:
|
53 |
+
- Social Media
|
54 |
+
- Reddit
|
55 |
+
- Topic Classification
|
56 |
+
- Text Classification
|
57 |
+
- Greek NLP
|
58 |
+
---
|
59 |
+
|
60 |
+
# Greek-Reddit-BERT
|
61 |
+
|
62 |
+
A Greek topic classification model based on [GREEK-BERT](https://huggingface.co/nlpaueb/bert-base-greek-uncased-v1)
|
63 |
+
This model is fine-tuned on [GreekReddit](https://huggingface.co/datasets/IMISLab/GreekReddit) as part of our upcoming research paper:
|
64 |
+
[Mastrokostas, C., Giarelis, N., & Karacapilidis, N. (2024) Social Media Topic Classification on Greek Reddit]()
|
65 |
+
For more information see the evaluation section below.
|
66 |
+
|
67 |
+
## Training dataset
|
68 |
+
|
69 |
+
The training dataset of `Greek-Reddit-BERT` is [GreekReddit](https://huggingface.co/datasets/IMISLab/GreekReddit), which is a topic classification dataset.
|
70 |
+
Overall, [GreekReddit](https://huggingface.co/datasets/IMISLab/GreekReddit) contains 6,534 user posts collected from Greek subreddits belonging to various topics (i.e., society, politics, economy, entertainment/culture, sports).
|
71 |
+
|
72 |
+
## Training configuration
|
73 |
+
|
74 |
+
We fine-tuned `nlpaueb/bert-base-greek-uncased-v1` (110 million parameters) on the GreekReddit train split using the following parameters:
|
75 |
+
* GPU batch size = 16
|
76 |
+
* Total training epochs = 4
|
77 |
+
* Learning rate = 5e−5
|
78 |
+
* Dropout Rate = 0.1
|
79 |
+
* Number of labels = 10
|
80 |
+
* No warmup steps
|
81 |
+
* 32-bit floating precision
|
82 |
+
* Tokenization
|
83 |
+
* maximum input token length = 512
|
84 |
+
* padding = True
|
85 |
+
* truncation = True
|
86 |
+
|
87 |
+
## Evaluation
|
88 |
+
**Model**|**Precision**|**Recall**|**F1**|**Hamming Loss**
|
89 |
+
------------|-----------|-----------|-----------|-------------
|
90 |
+
Greek-Reddit-BERT|80.05|81.48|80.61|19.84
|
91 |
+
|
92 |
+
|
93 |
+
### Example code
|
94 |
+
```python
|
95 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
|
96 |
+
|
97 |
+
model_name = 'IMISLab/Greek-Reddit-BERT'
|
98 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
99 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
100 |
+
|
101 |
+
topic_classifier = pipeline(
|
102 |
+
'text-classification',
|
103 |
+
device = 'cpu',
|
104 |
+
model = model,
|
105 |
+
tokenizer = tokenizer,
|
106 |
+
truncation = True,
|
107 |
+
max_length = 512
|
108 |
+
)
|
109 |
+
|
110 |
+
text = 'Άλλες οικονομίες, όπως η Κίνα, προσπαθούν να διατηρούν την αξία του νομίσματος τους χαμηλά ώστε να καταστήσουν τις εξαγωγές τους πιο ελκυστικές στο εξωτερικό. Γιατί όμως θεωρούμε πως η πτωτική πορεία της Τουρκικής λίρας είναι η ""αχίλλειος πτέρνα"" της Τουρκίας;'
|
111 |
+
output = topic_classifier(text)
|
112 |
+
print(output[0]['label'])
|
113 |
+
```
|
114 |
+
## Contact
|
115 |
+
|
116 |
+
If you have any questions/feedback about the model please e-mail one of the following authors:
|
117 |
+
```
|
118 | |
119 | |
120 | |
121 |
+
```
|
122 |
+
## Citation
|
123 |
+
|
124 |
+
```
|
125 |
+
TBA
|
126 |
+
```
|