Update README.md
Browse files
README.md
CHANGED
|
@@ -34,9 +34,12 @@ The model leverages the BertForSequenceClassification architecture, It has been
|
|
| 34 |
## Example
|
| 35 |
|
| 36 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
|
|
|
| 37 |
import numpy as np
|
|
|
|
| 38 |
from scipy.special import expit
|
| 39 |
|
|
|
|
| 40 |
MODEL = "PavanDeepak/Topic_Classification"
|
| 41 |
tokenizer = AutoTokenizer.from_pretrained(MODEL)
|
| 42 |
model = AutoModelForSequenceClassification.from_pretrained(MODEL)
|
|
@@ -51,7 +54,9 @@ scores = expit(scores)
|
|
| 51 |
predictions = (scores >= 0.5) * 1
|
| 52 |
|
| 53 |
for i in range(len(predictions)):
|
|
|
|
| 54 |
if predictions[i]:
|
|
|
|
| 55 |
print(class_mapping[i])
|
| 56 |
|
| 57 |
|
|
|
|
| 34 |
## Example
|
| 35 |
|
| 36 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 37 |
+
|
| 38 |
import numpy as np
|
| 39 |
+
|
| 40 |
from scipy.special import expit
|
| 41 |
|
| 42 |
+
|
| 43 |
MODEL = "PavanDeepak/Topic_Classification"
|
| 44 |
tokenizer = AutoTokenizer.from_pretrained(MODEL)
|
| 45 |
model = AutoModelForSequenceClassification.from_pretrained(MODEL)
|
|
|
|
| 54 |
predictions = (scores >= 0.5) * 1
|
| 55 |
|
| 56 |
for i in range(len(predictions)):
|
| 57 |
+
|
| 58 |
if predictions[i]:
|
| 59 |
+
|
| 60 |
print(class_mapping[i])
|
| 61 |
|
| 62 |
|