Di12 commited on
Commit
dbd9c51
·
1 Parent(s): e01d80d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -245,10 +245,7 @@ def process_input(text_input, file):
245
 
246
  df = pd.DataFrame(results)
247
 
248
- # Áp dụng định dạng hiển thị với 3 chữ số phần thập phân cho cột 'Xác suất'
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,