Update app.py
Browse files
app.py
CHANGED
@@ -50,80 +50,81 @@ tone_categories = {
|
|
50 |
# Frame categories for fallback method
|
51 |
|
52 |
# AI-Expanded Frame Categories for More Precise Categorization
|
|
|
53 |
frame_categories = {
|
54 |
"Human Rights & Justice": {
|
55 |
-
"Legal Rights & Reforms": ["law", "justice", "legal", "reforms", "legislation"],
|
56 |
-
"Humanitarian Issues": ["humanitarian", "aid", "refugees", "asylum", "crisis response"],
|
57 |
-
"Civil Liberties": ["freedom", "expression", "privacy", "rights violations"]
|
58 |
},
|
59 |
"Political & State Accountability": {
|
60 |
-
"Corruption & Governance": ["corruption", "government", "policy", "accountability", "transparency"],
|
61 |
-
"Political Oppression": ["authoritarianism", "censorship", "state control", "dissent", "crackdown"],
|
62 |
-
"Elections & Political Representation": ["voting", "elections", "political participation", "democracy"]
|
63 |
},
|
64 |
"Gender & Patriarchy": {
|
65 |
-
"Gender-Based Violence": ["violence", "domestic abuse", "sexual harassment", "femicide"],
|
66 |
-
"Women's Rights & Equality": ["gender equality", "feminism", "reproductive rights", "patriarchy"],
|
67 |
-
"LGBTQ+ Rights": ["queer rights", "LGBTQ+", "gender identity", "trans rights", "homophobia"]
|
68 |
},
|
69 |
"Religious Freedom & Persecution": {
|
70 |
-
"Religious Discrimination": ["persecution", "intolerance", "sectarianism", "faith-based violence"],
|
71 |
-
"Religious Minorities' Rights": ["minorities", "blasphemy laws", "religious freedom", "forced conversion"]
|
72 |
},
|
73 |
"Grassroots Mobilization": {
|
74 |
-
"Community Activism": ["activism", "grassroots", "volunteering", "local organizing"],
|
75 |
-
"Protests & Demonstrations": ["march", "strike", "rally", "sit-in", "boycott"],
|
76 |
-
"Coalition Building": ["solidarity", "collaboration", "alliances", "mutual aid"]
|
77 |
},
|
78 |
"Environmental Crisis & Activism": {
|
79 |
-
"Climate Change Awareness": ["climate crisis", "global warming", "carbon emissions", "fossil fuels"],
|
80 |
-
"Conservation & Sustainability": ["deforestation", "wildlife protection", "biodiversity"],
|
81 |
-
"Environmental Justice": ["pollution", "water crisis", "land rights", "indigenous rights"]
|
82 |
},
|
83 |
"Anti-Extremism & Anti-Violence": {
|
84 |
-
"Hate Speech & Radicalization": ["hate speech", "extremism", "online radicalization", "propaganda"],
|
85 |
-
"Mob & Sectarian Violence": ["mob attack", "lynching", "sectarian violence", "hate crimes"],
|
86 |
-
"Counterterrorism & De-Radicalization": ["terrorism", "prevention", "peacebuilding", "rehabilitation"]
|
87 |
},
|
88 |
"Social Inequality & Economic Disparities": {
|
89 |
-
"Class Privilege & Labor Rights": ["classism", "labor rights", "unions", "wage gap"],
|
90 |
-
"Poverty & Economic Justice": ["poverty", "inequality", "economic disparity", "wealth gap"],
|
91 |
-
"Housing & Healthcare": ["housing crisis", "healthcare access", "social safety nets"]
|
92 |
},
|
93 |
"Activism & Advocacy": {
|
94 |
-
"Policy Advocacy & Legal Reforms": ["campaign", "policy change", "legal advocacy"],
|
95 |
-
"Social Media Activism": ["hashtags", "digital activism", "awareness campaign"],
|
96 |
-
"Freedom of Expression & Press": ["press freedom", "censorship", "media rights"]
|
97 |
},
|
98 |
"Systemic Oppression": {
|
99 |
-
"Marginalized Communities": ["minorities", "exclusion", "systemic discrimination"],
|
100 |
-
"Racial & Ethnic Discrimination": ["racism", "xenophobia", "ethnic cleansing", "casteism"],
|
101 |
-
"Institutional Bias": ["institutional racism", "structural oppression", "biased laws"]
|
102 |
},
|
103 |
"Intersectionality": {
|
104 |
-
"Multiple Oppressions": ["overlapping struggles", "intersecting identities", "double discrimination"],
|
105 |
-
"Women & Marginalized Identities": ["feminism", "queer feminism", "minority women"],
|
106 |
-
"Global Solidarity Movements": ["transnational activism", "cross-movement solidarity"]
|
107 |
},
|
108 |
"Call to Action": {
|
109 |
-
"Petitions & Direct Action": ["sign petition", "protest", "boycott"],
|
110 |
-
"Fundraising & Support": ["donate", "crowdfunding", "aid support"],
|
111 |
-
"Policy & Legislative Action": ["policy change", "demand action", "write to lawmakers"]
|
112 |
},
|
113 |
"Empowerment & Resistance": {
|
114 |
-
"Grassroots Organizing": ["community empowerment", "leadership training"],
|
115 |
-
"Revolutionary Movements": ["resistance", "revolt", "revolutionary change"],
|
116 |
-
"Inspiration & Motivational Messaging": ["hope", "courage", "overcoming struggles"]
|
117 |
},
|
118 |
"Climate Justice": {
|
119 |
-
"Indigenous Environmental Activism": ["land rights", "indigenous climate leadership"],
|
120 |
-
"Corporate Accountability": ["big oil", "corporate greed", "environmental negligence"],
|
121 |
-
"Sustainable Development": ["eco-friendly", "renewable energy", "circular economy"]
|
122 |
},
|
123 |
"Human Rights Advocacy": {
|
124 |
-
"Criminal Justice Reform": ["police brutality", "wrongful convictions", "prison reform"],
|
125 |
-
"Workplace Discrimination & Labor Rights": ["workplace bias", "equal pay", "unions"],
|
126 |
-
"International Human Rights": ["humanitarian law", "UN declarations", "international treaties"]
|
127 |
}
|
128 |
}
|
129 |
|
|
|
50 |
# Frame categories for fallback method
|
51 |
|
52 |
# AI-Expanded Frame Categories for More Precise Categorization
|
53 |
+
# Expanded Frame Categories for Better Categorization
|
54 |
frame_categories = {
|
55 |
"Human Rights & Justice": {
|
56 |
+
"Legal Rights & Reforms": ["law", "justice", "legal", "reforms", "legislation", "rights", "human rights", "court", "trial", "lawsuit", "due process"],
|
57 |
+
"Humanitarian Issues": ["humanitarian", "aid", "refugees", "asylum", "crisis response", "displacement", "famine", "disaster relief", "war victims", "NGO support"],
|
58 |
+
"Civil Liberties": ["freedom", "expression", "privacy", "rights violations", "censorship", "surveillance", "press freedom", "free speech", "whistleblower"]
|
59 |
},
|
60 |
"Political & State Accountability": {
|
61 |
+
"Corruption & Governance": ["corruption", "government", "policy", "accountability", "transparency", "bribery", "misuse of power", "scandal", "nepotism", "tax fraud"],
|
62 |
+
"Political Oppression": ["authoritarianism", "censorship", "state control", "dissent", "crackdown", "political prisoners", "martial law", "dictatorship", "state violence"],
|
63 |
+
"Elections & Political Representation": ["voting", "elections", "political participation", "democracy", "voter suppression", "fraud", "ballot", "electoral reform"]
|
64 |
},
|
65 |
"Gender & Patriarchy": {
|
66 |
+
"Gender-Based Violence": ["violence", "domestic abuse", "sexual harassment", "femicide", "sexual assault", "stalking", "forced marriage", "gender violence"],
|
67 |
+
"Women's Rights & Equality": ["gender equality", "feminism", "reproductive rights", "patriarchy", "pay gap", "maternal health", "women's leadership", "workplace discrimination"],
|
68 |
+
"LGBTQ+ Rights": ["queer rights", "LGBTQ+", "gender identity", "trans rights", "homophobia", "pride", "same-sex marriage", "conversion therapy", "non-binary"]
|
69 |
},
|
70 |
"Religious Freedom & Persecution": {
|
71 |
+
"Religious Discrimination": ["persecution", "intolerance", "sectarianism", "faith-based violence", "hate crime", "blasphemy", "religious hate speech"],
|
72 |
+
"Religious Minorities' Rights": ["minorities", "blasphemy laws", "religious freedom", "forced conversion", "places of worship", "religious refugee", "interfaith dialogue"]
|
73 |
},
|
74 |
"Grassroots Mobilization": {
|
75 |
+
"Community Activism": ["activism", "grassroots", "volunteering", "local organizing", "community engagement", "mutual aid", "citizen action"],
|
76 |
+
"Protests & Demonstrations": ["march", "strike", "rally", "sit-in", "boycott", "mass mobilization", "civil disobedience", "public gathering"],
|
77 |
+
"Coalition Building": ["solidarity", "collaboration", "alliances", "mutual aid", "networking", "joint statement", "collective movement"]
|
78 |
},
|
79 |
"Environmental Crisis & Activism": {
|
80 |
+
"Climate Change Awareness": ["climate crisis", "global warming", "carbon emissions", "fossil fuels", "sea level rise", "heatwaves", "melting ice caps"],
|
81 |
+
"Conservation & Sustainability": ["deforestation", "wildlife protection", "biodiversity", "reforestation", "green energy", "sustainable agriculture", "plastic pollution"],
|
82 |
+
"Environmental Justice": ["pollution", "water crisis", "land rights", "indigenous rights", "eco-activism", "environmental racism", "waste management"]
|
83 |
},
|
84 |
"Anti-Extremism & Anti-Violence": {
|
85 |
+
"Hate Speech & Radicalization": ["hate speech", "extremism", "online radicalization", "propaganda", "far-right groups", "hate groups"],
|
86 |
+
"Mob & Sectarian Violence": ["mob attack", "lynching", "sectarian violence", "hate crimes", "communal riots", "armed militia"],
|
87 |
+
"Counterterrorism & De-Radicalization": ["terrorism", "prevention", "peacebuilding", "rehabilitation", "extremist ideology", "security policy"]
|
88 |
},
|
89 |
"Social Inequality & Economic Disparities": {
|
90 |
+
"Class Privilege & Labor Rights": ["classism", "labor rights", "unions", "wage gap", "worker exploitation", "fair wages", "labor strikes"],
|
91 |
+
"Poverty & Economic Justice": ["poverty", "inequality", "economic disparity", "wealth gap", "unemployment", "food insecurity"],
|
92 |
+
"Housing & Healthcare": ["housing crisis", "healthcare access", "social safety nets", "homelessness", "medicaid", "affordable housing"]
|
93 |
},
|
94 |
"Activism & Advocacy": {
|
95 |
+
"Policy Advocacy & Legal Reforms": ["campaign", "policy change", "legal advocacy", "legislative reform", "policy shift", "lobbying"],
|
96 |
+
"Social Media Activism": ["hashtags", "digital activism", "awareness campaign", "viral movement", "online protest", "cyber activism"],
|
97 |
+
"Freedom of Expression & Press": ["press freedom", "censorship", "media rights", "journalist safety", "fake news", "whistleblowing"]
|
98 |
},
|
99 |
"Systemic Oppression": {
|
100 |
+
"Marginalized Communities": ["minorities", "exclusion", "systemic discrimination", "oppression", "intersectionality"],
|
101 |
+
"Racial & Ethnic Discrimination": ["racism", "xenophobia", "ethnic cleansing", "casteism", "racial profiling", "hate speech"],
|
102 |
+
"Institutional Bias": ["institutional racism", "structural oppression", "biased laws", "discriminatory policies"]
|
103 |
},
|
104 |
"Intersectionality": {
|
105 |
+
"Multiple Oppressions": ["overlapping struggles", "intersecting identities", "double discrimination", "marginalization"],
|
106 |
+
"Women & Marginalized Identities": ["feminism", "queer feminism", "minority women", "disabled women", "indigenous women"],
|
107 |
+
"Global Solidarity Movements": ["transnational activism", "cross-movement solidarity", "international justice"]
|
108 |
},
|
109 |
"Call to Action": {
|
110 |
+
"Petitions & Direct Action": ["sign petition", "protest", "boycott", "demonstrate", "advocate"],
|
111 |
+
"Fundraising & Support": ["donate", "crowdfunding", "aid support", "mutual aid funds", "relief efforts"],
|
112 |
+
"Policy & Legislative Action": ["policy change", "demand action", "write to lawmakers", "call your representative"]
|
113 |
},
|
114 |
"Empowerment & Resistance": {
|
115 |
+
"Grassroots Organizing": ["community empowerment", "leadership training", "civil resistance", "community building"],
|
116 |
+
"Revolutionary Movements": ["resistance", "revolt", "revolutionary change", "radical change", "freedom fighters"],
|
117 |
+
"Inspiration & Motivational Messaging": ["hope", "courage", "overcoming struggles", "empowerment", "transformative justice"]
|
118 |
},
|
119 |
"Climate Justice": {
|
120 |
+
"Indigenous Environmental Activism": ["land rights", "indigenous climate leadership", "tribal land protection", "environmental sovereignty"],
|
121 |
+
"Corporate Accountability": ["big oil", "corporate greed", "environmental negligence", "corporate responsibility"],
|
122 |
+
"Sustainable Development": ["eco-friendly", "renewable energy", "circular economy", "climate resilience"]
|
123 |
},
|
124 |
"Human Rights Advocacy": {
|
125 |
+
"Criminal Justice Reform": ["police brutality", "wrongful convictions", "prison reform", "mass incarceration"],
|
126 |
+
"Workplace Discrimination & Labor Rights": ["workplace bias", "equal pay", "unions", "workplace harassment"],
|
127 |
+
"International Human Rights": ["humanitarian law", "UN declarations", "international treaties", "human rights violations"]
|
128 |
}
|
129 |
}
|
130 |
|