Spaces:
Build error
Build error
Update app.py
Browse files
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 |
-
|
| 68 |
if not keycheck:
|
| 69 |
-
container1.
|
|
|
|
| 70 |
else:
|
| 71 |
-
container1.
|
|
|
|
| 72 |
|
| 73 |
#===check any obj===
|
| 74 |
coldf = sorted(data.select_dtypes(include=['object']).columns.tolist())
|
| 75 |
-
|
| 76 |
container2 = st.container(border=True)
|
| 77 |
-
|
| 78 |
-
|
| 79 |
if not coldf:
|
| 80 |
-
container2.
|
|
|
|
| 81 |
else:
|
| 82 |
-
container2.
|
|
|
|
| 83 |
|
| 84 |
with col2:
|
| 85 |
#===bidirected===
|
| 86 |
container3 = st.container(border=True)
|
| 87 |
-
|
| 88 |
-
|
| 89 |
if not keycheck:
|
| 90 |
-
container3.
|
|
|
|
| 91 |
else:
|
| 92 |
-
container3.
|
|
|
|
| 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 |
-
|
| 104 |
|
| 105 |
if not miss_col:
|
| 106 |
-
container4.
|
|
|
|
| 107 |
else:
|
|
|
|
| 108 |
miss_col_str = ', '.join(miss_col)
|
| 109 |
-
container4.write(f"
|
|
|
|
| 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.")
|