faizhalas commited on
Commit
8189526
Β·
verified Β·
1 Parent(s): 8f2d523

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -17
app.py CHANGED
@@ -62,34 +62,36 @@ if uploaded_file is not None:
62
  #===check keywords===
63
  keycheck = list(data.columns)
64
  keycheck = [k for k in keycheck if 'Keyword' in k]
65
-
66
  container1 = st.container(border=True)
67
- container1.subheader('Keyword Stem', divider='red')
68
  if not keycheck:
69
- container1.write("❌ Unfortunately, you don't have a column containing keywords in your data. Please check again. If you want to use it in another column, please rename it to 'Keywords'.")
 
70
  else:
71
- container1.write('βœ… Congratulations! You can use Keywords Stem')
 
72
 
73
  #===check any obj===
74
  coldf = sorted(data.select_dtypes(include=['object']).columns.tolist())
75
-
76
  container2 = st.container(border=True)
77
- container2.subheader('Topic Modeling', divider='red')
78
-
79
  if not coldf:
80
- container2.write("❌ Unfortunately, you don't have a column containing object in your data. Please check again.")
 
81
  else:
82
- container2.write('βœ… Congratulations! You can use Topic Modeling')
 
83
 
84
  with col2:
85
  #===bidirected===
86
  container3 = st.container(border=True)
87
- container3.subheader('Bidirected Network', divider='red')
88
-
89
  if not keycheck:
90
- container3.write("❌ Unfortunately, you don't have a column containing keywords in your data. Please check again. If you want to use it in another column, please rename it to 'Keywords'.")
 
91
  else:
92
- container3.write('βœ… Congratulations! You can use Bidirected Network')
 
93
 
94
  #===Visualization===
95
  if 'Publication Year' in data.columns:
@@ -98,12 +100,13 @@ if uploaded_file is not None:
98
 
99
  col2check = ['Document Type','Source title','Cited by','Year']
100
  miss_col = [column for column in col2check if column not in data.columns]
101
-
102
  container4 = st.container(border=True)
103
- container4.subheader('Sunburst', divider='red')
104
 
105
  if not miss_col:
106
- container4.write('βœ… Congratulations! You can use Sunburst')
 
107
  else:
 
108
  miss_col_str = ', '.join(miss_col)
109
- container4.write(f"❌ Unfortunately, you don't have: {miss_col_str}. Please check again.")
 
62
  #===check keywords===
63
  keycheck = list(data.columns)
64
  keycheck = [k for k in keycheck if 'Keyword' in k]
 
65
  container1 = st.container(border=True)
66
+
67
  if not keycheck:
68
+ container1.subheader('❌ Keyword Stem', divider='red')
69
+ container1.write("Unfortunately, you don't have a column containing keywords in your data. Please check again. If you want to use it in another column, please rename it to 'Keywords'.")
70
  else:
71
+ container1.subheader('βœ”οΈ Keyword Stem', divider='blue')
72
+ container1.write('Congratulations! You can use Keywords Stem')
73
 
74
  #===check any obj===
75
  coldf = sorted(data.select_dtypes(include=['object']).columns.tolist())
 
76
  container2 = st.container(border=True)
77
+
 
78
  if not coldf:
79
+ container2.subheader('❌ Topic Modeling', divider='red')
80
+ container2.write("Unfortunately, you don't have a column containing object in your data. Please check again.")
81
  else:
82
+ container2.subheader('βœ”οΈ Topic Modeling', divider='blue')
83
+ container2.write('Congratulations! You can use Topic Modeling')
84
 
85
  with col2:
86
  #===bidirected===
87
  container3 = st.container(border=True)
88
+
 
89
  if not keycheck:
90
+ container3.subheader('❌ Bidirected Network', divider='red')
91
+ container3.write("Unfortunately, you don't have a column containing keywords in your data. Please check again. If you want to use it in another column, please rename it to 'Keywords'.")
92
  else:
93
+ container3.subheader('βœ”οΈ Bidirected Network', divider='blue')
94
+ container3.write('Congratulations! You can use Bidirected Network')
95
 
96
  #===Visualization===
97
  if 'Publication Year' in data.columns:
 
100
 
101
  col2check = ['Document Type','Source title','Cited by','Year']
102
  miss_col = [column for column in col2check if column not in data.columns]
 
103
  container4 = st.container(border=True)
104
+
105
 
106
  if not miss_col:
107
+ container4.subheader('βœ”οΈ Sunburst', divider='blue')
108
+ container4.write('Congratulations! You can use Sunburst')
109
  else:
110
+ container4.subheader('❌ Sunburst', divider='red')
111
  miss_col_str = ', '.join(miss_col)
112
+ container4.write(f"Unfortunately, you don't have: {miss_col_str}. Please check again.")