Upload 4 files
Browse files- README.md +33 -0
- config.json +59 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
README.md
CHANGED
@@ -1,3 +1,36 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language: en
|
3 |
+
tags:
|
4 |
+
- text-classification
|
5 |
+
- hazard-detection
|
6 |
+
datasets:
|
7 |
+
- your-dataset-name
|
8 |
license: apache-2.0
|
9 |
+
model_name: Quintu/roberta-large-512-hazard
|
10 |
+
library_name: transformers
|
11 |
+
pipeline_tag: text-classification
|
12 |
---
|
13 |
+
# Quintu/roberta-large-512-hazard
|
14 |
+
|
15 |
+
Mô hình `Quintu/roberta-large-512-hazard` được thiết kế để thực hiện phân loại văn bản liên quan đến phát hiện nguy cơ.
|
16 |
+
|
17 |
+
## Cách sử dụng
|
18 |
+
|
19 |
+
Dưới đây là cách sử dụng mô hình này với thư viện `transformers`:
|
20 |
+
|
21 |
+
```python
|
22 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
23 |
+
|
24 |
+
# Tải mô hình và tokenizer
|
25 |
+
model_name = "Quintu/roberta-large-512-hazard"
|
26 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
27 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
28 |
+
|
29 |
+
# Sử dụng mô hình để phân loại văn bản
|
30 |
+
text = "This is an example text to classify."
|
31 |
+
inputs = tokenizer(text, return_tensors="pt")
|
32 |
+
outputs = model(**inputs)
|
33 |
+
|
34 |
+
# Dự đoán
|
35 |
+
logits = outputs.logits
|
36 |
+
print(logits)
|
config.json
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "microsoft/deberta-v3-large",
|
3 |
+
"architectures": [
|
4 |
+
"DebertaV2ForSequenceClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"hidden_act": "gelu",
|
8 |
+
"hidden_dropout_prob": 0.1,
|
9 |
+
"hidden_size": 1024,
|
10 |
+
"id2label": {
|
11 |
+
"0": "allergens",
|
12 |
+
"1": "biological",
|
13 |
+
"2": "chemical",
|
14 |
+
"3": "food additives and flavourings",
|
15 |
+
"4": "foreign bodies",
|
16 |
+
"5": "fraud",
|
17 |
+
"6": "migration",
|
18 |
+
"7": "organoleptic aspects",
|
19 |
+
"8": "other hazard",
|
20 |
+
"9": "packaging defect"
|
21 |
+
},
|
22 |
+
"initializer_range": 0.02,
|
23 |
+
"intermediate_size": 4096,
|
24 |
+
"label2id": {
|
25 |
+
"allergens": 0,
|
26 |
+
"biological": 1,
|
27 |
+
"chemical": 2,
|
28 |
+
"food additives and flavourings": 3,
|
29 |
+
"foreign bodies": 4,
|
30 |
+
"fraud": 5,
|
31 |
+
"migration": 6,
|
32 |
+
"organoleptic aspects": 7,
|
33 |
+
"other hazard": 8,
|
34 |
+
"packaging defect": 9
|
35 |
+
},
|
36 |
+
"layer_norm_eps": 1e-07,
|
37 |
+
"max_position_embeddings": 512,
|
38 |
+
"max_relative_positions": -1,
|
39 |
+
"model_type": "deberta-v2",
|
40 |
+
"norm_rel_ebd": "layer_norm",
|
41 |
+
"num_attention_heads": 16,
|
42 |
+
"num_hidden_layers": 24,
|
43 |
+
"pad_token_id": 0,
|
44 |
+
"pooler_dropout": 0,
|
45 |
+
"pooler_hidden_act": "gelu",
|
46 |
+
"pooler_hidden_size": 1024,
|
47 |
+
"pos_att_type": [
|
48 |
+
"p2c",
|
49 |
+
"c2p"
|
50 |
+
],
|
51 |
+
"position_biased_input": false,
|
52 |
+
"position_buckets": 256,
|
53 |
+
"relative_attention": true,
|
54 |
+
"share_att_key": true,
|
55 |
+
"torch_dtype": "float32",
|
56 |
+
"transformers_version": "4.44.2",
|
57 |
+
"type_vocab_size": 0,
|
58 |
+
"vocab_size": 128100
|
59 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:934d6f28de5712e424a32dc32126d34c5501e1df6f4ca13a8a50d5cfd8b1029b
|
3 |
+
size 1740337248
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|