Yehor Smoliakov
commited on
Commit
•
61003b9
1
Parent(s):
cd04ded
Init
Browse files- .gitignore +1 -0
- README.md +39 -3
- config.json +108 -0
- model.safetensors +3 -0
- tokenizer_config.json +1 -0
- vocab.txt +0 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.DS_Store
|
README.md
CHANGED
@@ -1,3 +1,39 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: uk
|
3 |
+
|
4 |
+
datasets: Yehor/ual-topics
|
5 |
+
|
6 |
+
license: cc-by-nc-sa-4.0
|
7 |
+
---
|
8 |
+
|
9 |
+
## Metrics
|
10 |
+
|
11 |
+
- Epochs: 50
|
12 |
+
- Test accuracy: 0.62500
|
13 |
+
- F1 (MACRO): 0.46573
|
14 |
+
|
15 |
+
## How to use
|
16 |
+
|
17 |
+
```python
|
18 |
+
import torch
|
19 |
+
from transformers import AutoTokenizer, AutoModel
|
20 |
+
|
21 |
+
tokenizer = AutoTokenizer.from_pretrained("Yehor/ual-topics-classifier")
|
22 |
+
model = AutoModel.from_pretrained("Yehor/ual-topics-classifier")
|
23 |
+
|
24 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
25 |
+
|
26 |
+
topic_classifier = pipeline(task='text-classification', model=model, tokenizer=tokenizer, device=device)
|
27 |
+
|
28 |
+
question = """
|
29 |
+
Що мені робити на ВЛК
|
30 |
+
"""
|
31 |
+
|
32 |
+
print(topic_classifier(question))
|
33 |
+
|
34 |
+
question = """
|
35 |
+
Які мої дії для отримання аліментів на дитину
|
36 |
+
"""
|
37 |
+
|
38 |
+
print(topic_classifier(question))
|
39 |
+
```
|
config.json
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "Geotrend/distilbert-base-uk-cased",
|
3 |
+
"activation": "gelu",
|
4 |
+
"architectures": [
|
5 |
+
"DistilBertForSequenceClassification"
|
6 |
+
],
|
7 |
+
"attention_dropout": 0.1,
|
8 |
+
"dim": 768,
|
9 |
+
"dropout": 0.1,
|
10 |
+
"hidden_dim": 3072,
|
11 |
+
"id2label": {
|
12 |
+
"0": "inshe",
|
13 |
+
"1": "ekologiya",
|
14 |
+
"2": "ziemielnie_pravo",
|
15 |
+
"3": "reklama",
|
16 |
+
"4": "bankivska_diialnist",
|
17 |
+
"5": "prava_spozhivachiv",
|
18 |
+
"6": "medicina",
|
19 |
+
"7": "spadkove_pravo",
|
20 |
+
"8": "immighratsiia_iemighratsiia",
|
21 |
+
"9": "intieliektualna_vlasnist",
|
22 |
+
"10": "gospodarskie_pravo",
|
23 |
+
"11": "pidpriemnicka_dialnist",
|
24 |
+
"12": "opodatkuvannia",
|
25 |
+
"13": "piensiiata_sotsialni_viplati",
|
26 |
+
"14": "viiskovie_pravo",
|
27 |
+
"15": "sudova_praktika",
|
28 |
+
"16": "kriminalnie_pravo",
|
29 |
+
"17": "gromadianski_pravovidnosini",
|
30 |
+
"18": "strakhuvannya",
|
31 |
+
"19": "pratsevlashtuvvannya",
|
32 |
+
"20": "sotsialnyj_zakhist",
|
33 |
+
"21": "vighotovliennia_produktsiyi_ta_nadannia_poslugh",
|
34 |
+
"22": "litsienzuvannia",
|
35 |
+
"23": "reyestraciya_likvidaciya_bankrutstvo",
|
36 |
+
"24": "doghovirni_vidnosini",
|
37 |
+
"25": "administrativnie_pravo",
|
38 |
+
"26": "nierukhomist",
|
39 |
+
"27": "prava_vnutrishno_pieriemishchienikh_osib",
|
40 |
+
"28": "investitsii",
|
41 |
+
"29": "notarialni_pytanniia",
|
42 |
+
"30": "avtovlasnykam",
|
43 |
+
"31": "zhitlovi_pravovidnosini",
|
44 |
+
"32": "dovircha_vlastnist",
|
45 |
+
"33": "dierzhavni_zakupivli",
|
46 |
+
"34": "simejne_pravo",
|
47 |
+
"35": "mytne_pravo",
|
48 |
+
"36": "mizhnarodni_pravovidnosini",
|
49 |
+
"37": "korporativnie_pravo",
|
50 |
+
"38": "tsivilne_pravo"
|
51 |
+
},
|
52 |
+
"initializer_range": 0.02,
|
53 |
+
"label2id": {
|
54 |
+
"administrativnie_pravo": 25,
|
55 |
+
"avtovlasnykam": 30,
|
56 |
+
"bankivska_diialnist": 4,
|
57 |
+
"dierzhavni_zakupivli": 33,
|
58 |
+
"doghovirni_vidnosini": 24,
|
59 |
+
"dovircha_vlastnist": 32,
|
60 |
+
"ekologiya": 1,
|
61 |
+
"gospodarskie_pravo": 10,
|
62 |
+
"gromadianski_pravovidnosini": 17,
|
63 |
+
"immighratsiia_iemighratsiia": 8,
|
64 |
+
"inshe": 0,
|
65 |
+
"intieliektualna_vlasnist": 9,
|
66 |
+
"investitsii": 28,
|
67 |
+
"korporativnie_pravo": 37,
|
68 |
+
"kriminalnie_pravo": 16,
|
69 |
+
"litsienzuvannia": 22,
|
70 |
+
"medicina": 6,
|
71 |
+
"mizhnarodni_pravovidnosini": 36,
|
72 |
+
"mytne_pravo": 35,
|
73 |
+
"nierukhomist": 26,
|
74 |
+
"notarialni_pytanniia": 29,
|
75 |
+
"opodatkuvannia": 12,
|
76 |
+
"pidpriemnicka_dialnist": 11,
|
77 |
+
"piensiiata_sotsialni_viplati": 13,
|
78 |
+
"pratsevlashtuvvannya": 19,
|
79 |
+
"prava_spozhivachiv": 5,
|
80 |
+
"prava_vnutrishno_pieriemishchienikh_osib": 27,
|
81 |
+
"reklama": 3,
|
82 |
+
"reyestraciya_likvidaciya_bankrutstvo": 23,
|
83 |
+
"simejne_pravo": 34,
|
84 |
+
"sotsialnyj_zakhist": 20,
|
85 |
+
"spadkove_pravo": 7,
|
86 |
+
"strakhuvannya": 18,
|
87 |
+
"sudova_praktika": 15,
|
88 |
+
"tsivilne_pravo": 38,
|
89 |
+
"vighotovliennia_produktsiyi_ta_nadannia_poslugh": 21,
|
90 |
+
"viiskovie_pravo": 14,
|
91 |
+
"zhitlovi_pravovidnosini": 31,
|
92 |
+
"ziemielnie_pravo": 2
|
93 |
+
},
|
94 |
+
"max_position_embeddings": 512,
|
95 |
+
"model_type": "distilbert",
|
96 |
+
"n_heads": 12,
|
97 |
+
"n_layers": 6,
|
98 |
+
"output_past": true,
|
99 |
+
"pad_token_id": 0,
|
100 |
+
"problem_type": "single_label_classification",
|
101 |
+
"qa_dropout": 0.1,
|
102 |
+
"seq_classif_dropout": 0.2,
|
103 |
+
"sinusoidal_pos_embds": false,
|
104 |
+
"tie_weights_": true,
|
105 |
+
"torch_dtype": "float32",
|
106 |
+
"transformers_version": "4.42.4",
|
107 |
+
"vocab_size": 11811
|
108 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:44424169e0a108925e133c67817b3053b2db9de8e14400f0279cb1663ee02d69
|
3 |
+
size 210466132
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"do_lower_case": false, "model_max_length": 512}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|