Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,44 +13,8 @@ from chart_generation import *
|
|
13 |
from charts_advanced import *
|
14 |
from users_management import *
|
15 |
from code_df_custom import *
|
16 |
-
## BUGS =
|
17 |
from split_files_to_excel import *
|
18 |
|
19 |
-
### Functions needed for Classfication
|
20 |
-
|
21 |
-
def addCategories(df,df_all):
|
22 |
-
categories = df.to_dict("records")
|
23 |
-
categories_all = df_all.to_dict("list")
|
24 |
-
for cat in categories:
|
25 |
-
if cat['topic'] not in categories_all['topic']:
|
26 |
-
categories_all['topic'].append(cat['topic'])
|
27 |
-
categories_all['description'].append(cat['description'])
|
28 |
-
categories_all['experts'].append(cat['experts'])
|
29 |
-
print(f"AFTER ADDINGS Those are the categories_all : {categories_all}")
|
30 |
-
|
31 |
-
return gr.update(choices=categories_all['topic']),pd.DataFrame.from_dict(categories_all)
|
32 |
-
|
33 |
-
df_cat_filter = df_cate.to_dict("list")["topic"]
|
34 |
-
|
35 |
-
def filterByTopics(filters, categories):
|
36 |
-
value_filtered = []
|
37 |
-
categories = categories.to_dict("records")
|
38 |
-
for cat in categories:
|
39 |
-
if cat['topic'] in filters:
|
40 |
-
value_filtered.append(cat)
|
41 |
-
|
42 |
-
return gr.DataFrame(label='categories', value=pd.DataFrame(value_filtered), interactive=True)
|
43 |
-
|
44 |
-
### End
|
45 |
-
|
46 |
-
def reset_cate(df_categories):
|
47 |
-
if df_categories.equals(df_cate):
|
48 |
-
df_categories = pd.DataFrame([['', '', '']], columns=['topic', 'description', 'expert'])
|
49 |
-
else:
|
50 |
-
df_categories = df_cate.copy()
|
51 |
-
return df_categories
|
52 |
-
|
53 |
-
|
54 |
global value
|
55 |
value = set()
|
56 |
|
|
|
13 |
from charts_advanced import *
|
14 |
from users_management import *
|
15 |
from code_df_custom import *
|
|
|
16 |
from split_files_to_excel import *
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
global value
|
19 |
value = set()
|
20 |
|