ahm14 commited on
Commit
c477bc4
·
verified ·
1 Parent(s): 4ef9119

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -47,7 +47,7 @@ tone_categories = {
47
  "Hopeful": ["optimism", "better future", "faith", "confidence", "looking forward"]
48
  }
49
 
50
- # Frame categories with keywords
51
  frame_categories = {
52
  "Human Rights & Justice": ["rights", "law", "justice", "legal", "humanitarian"],
53
  "Political & State Accountability": ["government", "policy", "state", "corruption", "accountability"],
@@ -57,6 +57,13 @@ frame_categories = {
57
  "Environmental Crisis & Activism": ["climate", "deforestation", "water", "pollution", "sustainability"],
58
  "Anti-Extremism & Anti-Violence": ["extremism", "violence", "hate speech", "radicalism", "mob attack"],
59
  "Social Inequality & Economic Disparities": ["class privilege", "labor rights", "economic", "discrimination"],
 
 
 
 
 
 
 
60
  }
61
 
62
  # Detect language
@@ -100,7 +107,7 @@ def categorize_frames(frame_list):
100
  for i, (frame, count) in enumerate(sorted_frames):
101
  if i == 0: # Highest frequency frame
102
  categorized_frames["Major Focus"].append(frame)
103
- elif i < 5: # Top 3 most mentioned frames
104
  categorized_frames["Significant Focus"].append(frame)
105
  else:
106
  categorized_frames["Minor Mention"].append(frame)
 
47
  "Hopeful": ["optimism", "better future", "faith", "confidence", "looking forward"]
48
  }
49
 
50
+ # Frame categories for fallback method
51
  frame_categories = {
52
  "Human Rights & Justice": ["rights", "law", "justice", "legal", "humanitarian"],
53
  "Political & State Accountability": ["government", "policy", "state", "corruption", "accountability"],
 
57
  "Environmental Crisis & Activism": ["climate", "deforestation", "water", "pollution", "sustainability"],
58
  "Anti-Extremism & Anti-Violence": ["extremism", "violence", "hate speech", "radicalism", "mob attack"],
59
  "Social Inequality & Economic Disparities": ["class privilege", "labor rights", "economic", "discrimination"],
60
+ "Activism & Advocacy": ["justice", "rights", "demand", "protest", "march", "campaign", "freedom of speech"],
61
+ "Systemic Oppression": ["discrimination", "oppression", "minorities", "marginalized", "exclusion"],
62
+ "Intersectionality": ["intersecting", "women", "minorities", "struggles", "multiple oppression"],
63
+ "Call to Action": ["join us", "sign petition", "take action", "mobilize", "support movement"],
64
+ "Empowerment & Resistance": ["empower", "resist", "challenge", "fight for", "stand up"],
65
+ "Climate Justice": ["environment", "climate change", "sustainability", "biodiversity", "pollution"],
66
+ "Human Rights Advocacy": ["human rights", "violations", "honor killing", "workplace discrimination", "law reform"]
67
  }
68
 
69
  # Detect language
 
107
  for i, (frame, count) in enumerate(sorted_frames):
108
  if i == 0: # Highest frequency frame
109
  categorized_frames["Major Focus"].append(frame)
110
+ elif i < 3: # Top 3 most mentioned frames
111
  categorized_frames["Significant Focus"].append(frame)
112
  else:
113
  categorized_frames["Minor Mention"].append(frame)