Di12 commited on
Commit
053fec1
·
verified ·
1 Parent(s): bf3d2cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -251,9 +251,9 @@ def process_input(text_input, file):
251
  results.append({
252
  'Comment': comment,
253
  'Dự đoán': label,
254
- 'Xác suất tiêu cực': probability[0],
255
- 'Xác suất bình thường': probability[1],
256
- 'Xác suất tích cực': probability[2],
257
  })
258
 
259
  df2 = pd.DataFrame(results)
@@ -262,12 +262,12 @@ def process_input(text_input, file):
262
 
263
  with gr.Blocks() as demo:
264
  gr.Markdown("## Phân tích cảm xúc")
265
- gr.Markdown("Nhập bình luận (mỗi dòng một bình luận):")
266
  text_input = gr.Textbox(lines=6, placeholder="Nhập bình luận tại đây...", label="")
267
  gr.Markdown("Hoặc tải lên tệp .txt hoặc .csv chứa các bình luận:")
268
  file_input = gr.File(label="Tải tệp", file_types=[".txt", ".csv"])
269
  predict_button = gr.Button("Dự đoán")
270
- output_table = gr.Dataframe(headers=["Comment", "Dự đoán", 'Xác suất tiêu cực', 'Xác suất bình thường', 'Xác suất tích cực'], interactive=False)
271
 
272
  predict_button.click(
273
  fn=process_input,
 
251
  results.append({
252
  'Comment': comment,
253
  'Dự đoán': label,
254
+ 'Khả năng tiêu cực': probability[0],
255
+ 'Khả năng bình thường': probability[1],
256
+ 'Khả năng tích cực': probability[2],
257
  })
258
 
259
  df2 = pd.DataFrame(results)
 
262
 
263
  with gr.Blocks() as demo:
264
  gr.Markdown("## Phân tích cảm xúc")
265
+ gr.Markdown("Nhập bình luận:")
266
  text_input = gr.Textbox(lines=6, placeholder="Nhập bình luận tại đây...", label="")
267
  gr.Markdown("Hoặc tải lên tệp .txt hoặc .csv chứa các bình luận:")
268
  file_input = gr.File(label="Tải tệp", file_types=[".txt", ".csv"])
269
  predict_button = gr.Button("Dự đoán")
270
+ output_table = gr.Dataframe(headers=["Comment", "Dự đoán", 'Khả năng tiêu cực', 'Khả năng bình thường', 'Khả năng tích cực'], interactive=False)
271
 
272
  predict_button.click(
273
  fn=process_input,