rhea2809 commited on
Commit
aafb428
·
verified ·
1 Parent(s): 9a4e6f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +111 -121
app.py CHANGED
@@ -75,21 +75,10 @@ class DataList:
75
  return df
76
 
77
  @staticmethod
78
- def filter_table3(df: pd.DataFrame, filter_names3: list[str]) -> pd.DataFrame:
79
- # Ensure 'Hashtags' are clean and without extra spaces
80
- df.loc[:, 'Hashtags'] = df['Hashtags'].fillna("").astype(str)
81
- df.loc[:, 'Hashtags'] = df['Hashtags'].apply(lambda x: ' '.join(x.split())) # Remove extra spaces
82
-
83
- # Clean the filter names to ensure no extra spaces
84
- filter_names3 = [hashtag.strip() for hashtag in filter_names3]
85
-
86
- # Create the regex pattern, escaping special characters
87
- filter_pattern = '|'.join(map(re.escape, filter_names3))
88
-
89
- # Apply the filter using str.contains
90
- df_filtered = df[df['Hashtags'].str.contains(filter_pattern, case=False, regex=True)]
91
-
92
- return df_filtered
93
 
94
  @staticmethod
95
  def to_html(df: pd.DataFrame, table_header: str) -> str:
@@ -128,114 +117,115 @@ with gr.Blocks(css=css) as demo:
128
  filter_names = gr.CheckboxGroup(choices=["Responsible AI 101", "Responsible AI Governance", "AI System Risk and Assurance", "Generative and Agentic AI", "AI Regulation and Compliance", "AI Procurement"], value=["Responsible AI 101", "Responsible AI Governance", "AI System Risk and Assurance", "Generative and Agentic AI", "AI Regulation and Compliance", "AI Procurement"], label='Type')
129
  filter_names2 = gr.CheckboxGroup(choices=['Deck','Document/Report','Infogrphic','Video/Audio','Repository/Directory',], value=['Deck','Document/Report','Infogrphic','Video/Audio','Repository/Directory',], label='Type (Format)')
130
  filter_names3 = gr.CheckboxGroup(choices=[
131
- "#AIImpacts",
132
- "#AIAssessment&Audit",
133
- "#AIDesign",
134
- "#AIDevelopment",
135
- "#AIDeployment",
136
- "#AIMonitoring",
137
- "#AIOperating&Maintenance",
138
- "#AIDecommissioning",
139
- "#AITesting&Evaluation",
140
- "#AITraining",
141
- "#AIStandards",
142
- "#AIUseCase",
143
- "#Accountability&Transparency",
144
- "#CheatSheet",
145
- "#Checklist",
146
- "#CaseStudy",
147
- "#Cybersecurity",
148
- "#Data&AI",
149
- "#EUAIAct",
150
- "#EUGDPR",
151
- "#EmergingTopic",
152
- "#Explainability&Interpretability",
153
- "#FactSheet",
154
- "#Fairness&Bias",
155
- "#FederalRegulations",
156
- "#Frameworks",
157
- "#FrontierAI",
158
- "#ForAuditors",
159
- "#ForDevelopers",
160
- "#ForDeployers",
161
- "#ForLeadership",
162
- "#GlobalStandards",
163
- "#Glossary",
164
- "#Government&PublicSector",
165
- "#Guide",
166
- "#Healthcare",
167
- "#HR",
168
- "#ISO42001",
169
- "#Industrial",
170
- "#Manufacturing",
171
- "#Marketing",
172
- "#News&Journalism",
173
- "#Privacy",
174
- "#Report",
175
- "#Retail",
176
- "#Safety",
177
- "#Security&Resiliency",
178
- "#StateRegulations",
179
- "#Template",
180
- "#Toolkit",
181
- "#Training",
182
- "#Validity&Reliability",
183
- "#WhitePaper"
184
  ]
 
185
  , value=[
186
- "#AIImpacts",
187
- "#AIAssessment&Audit",
188
- "#AIDesign",
189
- "#AIDevelopment",
190
- "#AIDeployment",
191
- "#AIMonitoring",
192
- "#AIOperating&Maintenance",
193
- "#AIDecommissioning",
194
- "#AITesting&Evaluation",
195
- "#AITraining",
196
- "#AIStandards",
197
- "#AIUseCase",
198
- "#Accountability&Transparency",
199
- "#CheatSheet",
200
- "#Checklist",
201
- "#CaseStudy",
202
- "#Cybersecurity",
203
- "#Data&AI",
204
- "#EUAIAct",
205
- "#EUGDPR",
206
- "#EmergingTopic",
207
- "#Explainability&Interpretability",
208
- "#FactSheet",
209
- "#Fairness&Bias",
210
- "#FederalRegulations",
211
- "#Frameworks",
212
- "#FrontierAI",
213
- "#ForAuditors",
214
- "#ForDevelopers",
215
- "#ForDeployers",
216
- "#ForLeadership",
217
- "#GlobalStandards",
218
- "#Glossary",
219
- "#Government&PublicSector",
220
- "#Guide",
221
- "#Healthcare",
222
- "#HR",
223
- "#ISO42001",
224
- "#Industrial",
225
- "#Manufacturing",
226
- "#Marketing",
227
- "#News&Journalism",
228
- "#Privacy",
229
- "#Report",
230
- "#Retail",
231
- "#Safety",
232
- "#Security&Resiliency",
233
- "#StateRegulations",
234
- "#Template",
235
- "#Toolkit",
236
- "#Training",
237
- "#Validity&Reliability",
238
- "#WhitePaper"
239
  ], label='Hashtags')
240
  search_button = gr.Button('Search', size = 'sm', scale =1)
241
  table = gr.HTML(show_label=False)
 
75
  return df
76
 
77
  @staticmethod
78
+ def filter_table3(df: pd.DataFrame,filter_names3: list[str]) -> pd.DataFrame:
79
+ df.loc[:,'HashF'] = df['HashF'].fillna("").astype(str);
80
+ df= df[df.HashF.str.contains('|'.join(filter_names3),case=False, regex=True)]
81
+ return df
 
 
 
 
 
 
 
 
 
 
 
82
 
83
  @staticmethod
84
  def to_html(df: pd.DataFrame, table_header: str) -> str:
 
117
  filter_names = gr.CheckboxGroup(choices=["Responsible AI 101", "Responsible AI Governance", "AI System Risk and Assurance", "Generative and Agentic AI", "AI Regulation and Compliance", "AI Procurement"], value=["Responsible AI 101", "Responsible AI Governance", "AI System Risk and Assurance", "Generative and Agentic AI", "AI Regulation and Compliance", "AI Procurement"], label='Type')
118
  filter_names2 = gr.CheckboxGroup(choices=['Deck','Document/Report','Infogrphic','Video/Audio','Repository/Directory',], value=['Deck','Document/Report','Infogrphic','Video/Audio','Repository/Directory',], label='Type (Format)')
119
  filter_names3 = gr.CheckboxGroup(choices=[
120
+ "AIImpacts",
121
+ "AIAssessment&Audit",
122
+ "AIDesign",
123
+ "AIDevelopment",
124
+ "AIDeployment",
125
+ "AIMonitoring",
126
+ "AIOperating&Maintenance",
127
+ "AIDecommissioning",
128
+ "AITesting&Evaluation",
129
+ "AITraining",
130
+ "AIStandards",
131
+ "AIUseCase",
132
+ "Accountability&Transparency",
133
+ "CheatSheet",
134
+ "Checklist",
135
+ "CaseStudy",
136
+ "Cybersecurity",
137
+ "Data&AI",
138
+ "EUAIAct",
139
+ "EUGDPR",
140
+ "EmergingTopic",
141
+ "Explainability&Interpretability",
142
+ "FactSheet",
143
+ "Fairness&Bias",
144
+ "FederalRegulations",
145
+ "Frameworks",
146
+ "FrontierAI",
147
+ "ForAuditors",
148
+ "ForDevelopers",
149
+ "ForDeployers",
150
+ "ForLeadership",
151
+ "GlobalStandards",
152
+ "Glossary",
153
+ "Government&PublicSector",
154
+ "Guide",
155
+ "Healthcare",
156
+ "HR",
157
+ "ISO42001",
158
+ "Industrial",
159
+ "Manufacturing",
160
+ "Marketing",
161
+ "News&Journalism",
162
+ "Privacy",
163
+ "Report",
164
+ "Retail",
165
+ "Safety",
166
+ "Security&Resiliency",
167
+ "StateRegulations",
168
+ "Template",
169
+ "Toolkit",
170
+ "Training",
171
+ "Validity&Reliability",
172
+ "WhitePaper"
173
  ]
174
+
175
  , value=[
176
+ "AIImpacts",
177
+ "AIAssessment&Audit",
178
+ "AIDesign",
179
+ "AIDevelopment",
180
+ "AIDeployment",
181
+ "AIMonitoring",
182
+ "AIOperating&Maintenance",
183
+ "AIDecommissioning",
184
+ "AITesting&Evaluation",
185
+ "AITraining",
186
+ "AIStandards",
187
+ "AIUseCase",
188
+ "Accountability&Transparency",
189
+ "CheatSheet",
190
+ "Checklist",
191
+ "CaseStudy",
192
+ "Cybersecurity",
193
+ "Data&AI",
194
+ "EUAIAct",
195
+ "EUGDPR",
196
+ "EmergingTopic",
197
+ "Explainability&Interpretability",
198
+ "FactSheet",
199
+ "Fairness&Bias",
200
+ "FederalRegulations",
201
+ "Frameworks",
202
+ "FrontierAI",
203
+ "ForAuditors",
204
+ "ForDevelopers",
205
+ "ForDeployers",
206
+ "ForLeadership",
207
+ "GlobalStandards",
208
+ "Glossary",
209
+ "Government&PublicSector",
210
+ "Guide",
211
+ "Healthcare",
212
+ "HR",
213
+ "ISO42001",
214
+ "Industrial",
215
+ "Manufacturing",
216
+ "Marketing",
217
+ "News&Journalism",
218
+ "Privacy",
219
+ "Report",
220
+ "Retail",
221
+ "Safety",
222
+ "Security&Resiliency",
223
+ "StateRegulations",
224
+ "Template",
225
+ "Toolkit",
226
+ "Training",
227
+ "Validity&Reliability",
228
+ "WhitePaper"
229
  ], label='Hashtags')
230
  search_button = gr.Button('Search', size = 'sm', scale =1)
231
  table = gr.HTML(show_label=False)