Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,8 +16,8 @@ def predict_single(text):
|
|
16 |
|
17 |
result = classifier(text)[0]
|
18 |
return {
|
19 |
-
"negative (stars 1, 2 and 3)": f"{
|
20 |
-
"positive (stars 4 and 5)": f"{result['score']:.6f}" if result['label'] == 'positive' else f"{
|
21 |
}
|
22 |
|
23 |
def process_batch(file):
|
|
|
16 |
|
17 |
result = classifier(text)[0]
|
18 |
return {
|
19 |
+
"negative (stars 1, 2 and 3)": f"{result['score']:.6f}" if result['label'] == 'positive' else f"{1 - result['score']:.6f}",
|
20 |
+
"positive (stars 4 and 5)": f"{1 - result['score']:.6f}" if result['label'] == 'positive' else f"{result['score']:.6f}"
|
21 |
}
|
22 |
|
23 |
def process_batch(file):
|