Update app.py
Browse files
app.py
CHANGED
|
@@ -75,21 +75,10 @@ class DataList:
|
|
| 75 |
return df
|
| 76 |
|
| 77 |
@staticmethod
|
| 78 |
-
def filter_table3(df: pd.DataFrame,
|
| 79 |
-
|
| 80 |
-
df
|
| 81 |
-
|
| 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 |
-
"
|
| 132 |
-
"
|
| 133 |
-
"
|
| 134 |
-
"
|
| 135 |
-
"
|
| 136 |
-
"
|
| 137 |
-
"
|
| 138 |
-
"
|
| 139 |
-
"
|
| 140 |
-
"
|
| 141 |
-
"
|
| 142 |
-
"
|
| 143 |
-
"
|
| 144 |
-
"
|
| 145 |
-
"
|
| 146 |
-
"
|
| 147 |
-
"
|
| 148 |
-
"
|
| 149 |
-
"
|
| 150 |
-
"
|
| 151 |
-
"
|
| 152 |
-
"
|
| 153 |
-
"
|
| 154 |
-
"
|
| 155 |
-
"
|
| 156 |
-
"
|
| 157 |
-
"
|
| 158 |
-
"
|
| 159 |
-
"
|
| 160 |
-
"
|
| 161 |
-
"
|
| 162 |
-
"
|
| 163 |
-
"
|
| 164 |
-
"
|
| 165 |
-
"
|
| 166 |
-
"
|
| 167 |
-
"
|
| 168 |
-
"
|
| 169 |
-
"
|
| 170 |
-
"
|
| 171 |
-
"
|
| 172 |
-
"
|
| 173 |
-
"
|
| 174 |
-
"
|
| 175 |
-
"
|
| 176 |
-
"
|
| 177 |
-
"
|
| 178 |
-
"
|
| 179 |
-
"
|
| 180 |
-
"
|
| 181 |
-
"
|
| 182 |
-
"
|
| 183 |
-
"
|
| 184 |
]
|
|
|
|
| 185 |
, value=[
|
| 186 |
-
"
|
| 187 |
-
"
|
| 188 |
-
"
|
| 189 |
-
"
|
| 190 |
-
"
|
| 191 |
-
"
|
| 192 |
-
"
|
| 193 |
-
"
|
| 194 |
-
"
|
| 195 |
-
"
|
| 196 |
-
"
|
| 197 |
-
"
|
| 198 |
-
"
|
| 199 |
-
"
|
| 200 |
-
"
|
| 201 |
-
"
|
| 202 |
-
"
|
| 203 |
-
"
|
| 204 |
-
"
|
| 205 |
-
"
|
| 206 |
-
"
|
| 207 |
-
"
|
| 208 |
-
"
|
| 209 |
-
"
|
| 210 |
-
"
|
| 211 |
-
"
|
| 212 |
-
"
|
| 213 |
-
"
|
| 214 |
-
"
|
| 215 |
-
"
|
| 216 |
-
"
|
| 217 |
-
"
|
| 218 |
-
"
|
| 219 |
-
"
|
| 220 |
-
"
|
| 221 |
-
"
|
| 222 |
-
"
|
| 223 |
-
"
|
| 224 |
-
"
|
| 225 |
-
"
|
| 226 |
-
"
|
| 227 |
-
"
|
| 228 |
-
"
|
| 229 |
-
"
|
| 230 |
-
"
|
| 231 |
-
"
|
| 232 |
-
"
|
| 233 |
-
"
|
| 234 |
-
"
|
| 235 |
-
"
|
| 236 |
-
"
|
| 237 |
-
"
|
| 238 |
-
"
|
| 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)
|