Andyrasika
commited on
Commit
·
b12ea37
1
Parent(s):
f9a0995
Update README.md
Browse files
README.md
CHANGED
@@ -8,6 +8,12 @@ metrics:
|
|
8 |
model-index:
|
9 |
- name: bert_clf_results
|
10 |
results: []
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
---
|
12 |
|
13 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
@@ -57,10 +63,30 @@ The following hyperparameters were used during training:
|
|
57 |
| 0.7209 | 3.0 | 16204 | 0.8852 | 0.7121 |
|
58 |
| 0.4274 | 4.0 | 21604 | 0.9611 | 0.7011 |
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
### Framework versions
|
62 |
|
63 |
- Transformers 4.36.2
|
64 |
- Pytorch 2.1.0+cu118
|
65 |
- Datasets 2.16.0
|
66 |
-
- Tokenizers 0.15.0
|
|
|
8 |
model-index:
|
9 |
- name: bert_clf_results
|
10 |
results: []
|
11 |
+
datasets:
|
12 |
+
- app_reviews
|
13 |
+
language:
|
14 |
+
- en
|
15 |
+
library_name: transformers
|
16 |
+
pipeline_tag: text-classification
|
17 |
---
|
18 |
|
19 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
63 |
| 0.7209 | 3.0 | 16204 | 0.8852 | 0.7121 |
|
64 |
| 0.4274 | 4.0 | 21604 | 0.9611 | 0.7011 |
|
65 |
|
66 |
+
### Code Implementation
|
67 |
+
```
|
68 |
+
from transformers import AutoTokenizer
|
69 |
+
from transformers import AutoModelForSequenceClassification
|
70 |
+
|
71 |
+
tokenizer = AutoTokenizer.from_pretrained("Andyrasika/bert_clf_results")
|
72 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
73 |
+
|
74 |
+
|
75 |
+
model = AutoModelForSequenceClassification.from_pretrained("Andyrasika/bert_clf_results")
|
76 |
+
with torch.no_grad():
|
77 |
+
logits = model(**inputs).logits
|
78 |
+
|
79 |
+
predicted_class_id = logits.argmax().item()
|
80 |
+
model.config.id2label[predicted_class_id]
|
81 |
+
```
|
82 |
+
Output
|
83 |
+
```
|
84 |
+
'LABEL_4'
|
85 |
+
```
|
86 |
|
87 |
### Framework versions
|
88 |
|
89 |
- Transformers 4.36.2
|
90 |
- Pytorch 2.1.0+cu118
|
91 |
- Datasets 2.16.0
|
92 |
+
- Tokenizers 0.15.0
|