Update README.md
Browse files
README.md
CHANGED
|
@@ -66,8 +66,8 @@ from transformers import pipeline
|
|
| 66 |
|
| 67 |
clf = pipeline(
|
| 68 |
task="text-classification",
|
| 69 |
-
model="
|
| 70 |
-
tokenizer="
|
| 71 |
return_all_scores=False,
|
| 72 |
)
|
| 73 |
|
|
@@ -82,7 +82,7 @@ If you prefer friendly labels, you can map them:
|
|
| 82 |
from transformers import pipeline
|
| 83 |
|
| 84 |
id2name = {"LABEL_0": "negative", "LABEL_1": "positive"}
|
| 85 |
-
clf = pipeline("text-classification", model="
|
| 86 |
res = clf("This section lacks clarity and the experiments are inconclusive.")[0]
|
| 87 |
res["label"] = id2name.get(res["label"], res["label"]) # map to human-friendly label
|
| 88 |
print(res)
|
|
@@ -95,8 +95,8 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
|
| 95 |
import torch
|
| 96 |
|
| 97 |
device = 0 if torch.cuda.is_available() else -1
|
| 98 |
-
tok = AutoTokenizer.from_pretrained("
|
| 99 |
-
model = AutoModelForSequenceClassification.from_pretrained("
|
| 100 |
|
| 101 |
texts = [
|
| 102 |
"I recommend acceptance; the methodology is solid and results are convincing.",
|
|
|
|
| 66 |
|
| 67 |
clf = pipeline(
|
| 68 |
task="text-classification",
|
| 69 |
+
model="EvilScript/academic-sentiment-classifier",
|
| 70 |
+
tokenizer="EvilScript/academic-sentiment-classifier",
|
| 71 |
return_all_scores=False,
|
| 72 |
)
|
| 73 |
|
|
|
|
| 82 |
from transformers import pipeline
|
| 83 |
|
| 84 |
id2name = {"LABEL_0": "negative", "LABEL_1": "positive"}
|
| 85 |
+
clf = pipeline("text-classification", model="EvilScript/academic-sentiment-classifier")
|
| 86 |
res = clf("This section lacks clarity and the experiments are inconclusive.")[0]
|
| 87 |
res["label"] = id2name.get(res["label"], res["label"]) # map to human-friendly label
|
| 88 |
print(res)
|
|
|
|
| 95 |
import torch
|
| 96 |
|
| 97 |
device = 0 if torch.cuda.is_available() else -1
|
| 98 |
+
tok = AutoTokenizer.from_pretrained("EvilScript/academic-sentiment-classifier")
|
| 99 |
+
model = AutoModelForSequenceClassification.from_pretrained("EvilScript/academic-sentiment-classifier")
|
| 100 |
|
| 101 |
texts = [
|
| 102 |
"I recommend acceptance; the methodology is solid and results are convincing.",
|