Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,8 +33,8 @@ def process_batch(file):
|
|
33 |
pred = classifier(text)[0]
|
34 |
results.append({
|
35 |
"文本": text,
|
36 |
-
"negative (stars 1, 2 and 3)": f"{
|
37 |
-
"positive (stars 4 and 5)": f"{pred['score']:.6f}" if pred['label'] == 'positive' else f"{
|
38 |
})
|
39 |
|
40 |
df = pd.DataFrame(results)
|
|
|
33 |
pred = classifier(text)[0]
|
34 |
results.append({
|
35 |
"文本": text,
|
36 |
+
"negative (stars 1, 2 and 3)": f"{pred['score']:.6f}" if pred['label'] == 'positive' else f"{1 - pred['score']:.6f}",
|
37 |
+
"positive (stars 4 and 5)": f"{1 - pred['score']:.6f}" if pred['label'] == 'positive' else f"{pred['score']:.6f}"
|
38 |
})
|
39 |
|
40 |
df = pd.DataFrame(results)
|