Update README.md
Browse files
README.md
CHANGED
@@ -1,21 +0,0 @@
|
|
1 |
-
#Label 1 means relaxed and Label 0 means stressed
|
2 |
-
#To make custom predictions use the below code
|
3 |
-
|
4 |
-
# Use a pipeline as a high-level helper
|
5 |
-
|
6 |
-
|
7 |
-
from transformers import pipeline
|
8 |
-
|
9 |
-
pipe = pipeline("text-classification", model="sa-rehman/stress_classifier")
|
10 |
-
|
11 |
-
def predict(sentence):
|
12 |
-
|
13 |
-
pred=pipe.predict(sentence)
|
14 |
-
|
15 |
-
if pred[0].get("label")=='LABEL_1':
|
16 |
-
|
17 |
-
return "relaxed"
|
18 |
-
|
19 |
-
else:
|
20 |
-
|
21 |
-
return "stressed"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|