SonFox2920 commited on
Commit
74982b3
1 Parent(s): a35cd28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -21,15 +21,15 @@ if uploaded_file is not None:
21
  label_counts = df['label_id'].value_counts()
22
 
23
  # Hiển thị số lượng free_text của mỗi nhãn
24
- st.write("Số lượng nhãn HATE (2):", label_counts.get(2, 0))
25
- st.write("Số lượng nhãn CLEAN (0):", label_counts.get(0, 0))
26
  st.write("Số lượng nhãn OFFENSIVE (1):", label_counts.get(1, 0))
27
 
28
  # Hiển thị biểu đồ thống kê
29
  st.subheader("Biểu đồ thống kê")
30
- plt.figure(figsize=(8, 5))
31
- sns.countplot(x='label_id', data=df)
32
- st.pyplot()
33
 
34
  else:
35
- st.warning("Vui lòng upload file CSV.")
 
21
  label_counts = df['label_id'].value_counts()
22
 
23
  # Hiển thị số lượng free_text của mỗi nhãn
24
+ st.write("Số lượng nhãn OFFENSIVE (2):", label_counts.get(2, 0))
25
+ st.write("Số lượng nhãn Clean (0):", label_counts.get(0, 0))
26
  st.write("Số lượng nhãn OFFENSIVE (1):", label_counts.get(1, 0))
27
 
28
  # Hiển thị biểu đồ thống kê
29
  st.subheader("Biểu đồ thống kê")
30
+ fig, ax = plt.subplots(figsize=(8, 5))
31
+ sns.countplot(x='label_id', data=df, ax=ax)
32
+ st.pyplot(fig)
33
 
34
  else:
35
+ st.warning("Vui lòng upload file CSV.")