Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -245,10 +245,7 @@ def process_input(text_input, file):
|
|
| 245 |
|
| 246 |
df = pd.DataFrame(results)
|
| 247 |
|
| 248 |
-
|
| 249 |
-
styler = df.style.format({'Xác suất': '{:.3f}'})
|
| 250 |
-
|
| 251 |
-
return styler
|
| 252 |
|
| 253 |
with gr.Blocks() as demo:
|
| 254 |
gr.Markdown("## Phân tích cảm xúc")
|
|
@@ -257,7 +254,7 @@ with gr.Blocks() as demo:
|
|
| 257 |
gr.Markdown("Hoặc tải lên tệp .txt hoặc .csv chứa các bình luận:")
|
| 258 |
file_input = gr.File(label="Tải tệp", file_types=[".txt", ".csv"])
|
| 259 |
predict_button = gr.Button("Dự đoán")
|
| 260 |
-
output_table = gr.Dataframe(interactive=False)
|
| 261 |
|
| 262 |
predict_button.click(
|
| 263 |
fn=process_input,
|
|
|
|
| 245 |
|
| 246 |
df = pd.DataFrame(results)
|
| 247 |
|
| 248 |
+
return df
|
|
|
|
|
|
|
|
|
|
| 249 |
|
| 250 |
with gr.Blocks() as demo:
|
| 251 |
gr.Markdown("## Phân tích cảm xúc")
|
|
|
|
| 254 |
gr.Markdown("Hoặc tải lên tệp .txt hoặc .csv chứa các bình luận:")
|
| 255 |
file_input = gr.File(label="Tải tệp", file_types=[".txt", ".csv"])
|
| 256 |
predict_button = gr.Button("Dự đoán")
|
| 257 |
+
output_table = gr.Dataframe(headers=["Comment", "Dự đoán", "Xác suất"], interactive=False)
|
| 258 |
|
| 259 |
predict_button.click(
|
| 260 |
fn=process_input,
|