Spaces:
Sleeping
Sleeping
Ryan
commited on
Commit
·
48b3088
1
Parent(s):
da60688
update
Browse files- .idea/workspace.xml +1 -3
- processors/bias_processor.py +16 -1
.idea/workspace.xml
CHANGED
@@ -6,9 +6,7 @@
|
|
6 |
<component name="ChangeListManager">
|
7 |
<list default="true" id="8e67814c-7f04-433c-ab7a-2b65a1106d4c" name="Changes" comment="">
|
8 |
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
9 |
-
<change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
|
10 |
<change beforePath="$PROJECT_DIR$/processors/bias_processor.py" beforeDir="false" afterPath="$PROJECT_DIR$/processors/bias_processor.py" afterDir="false" />
|
11 |
-
<change beforePath="$PROJECT_DIR$/ui/analysis_screen.py" beforeDir="false" afterPath="$PROJECT_DIR$/ui/analysis_screen.py" afterDir="false" />
|
12 |
</list>
|
13 |
<option name="SHOW_DIALOG" value="false" />
|
14 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
@@ -65,7 +63,7 @@
|
|
65 |
<option name="presentableId" value="Default" />
|
66 |
<updated>1745170754325</updated>
|
67 |
<workItem from="1745170755404" duration="245000" />
|
68 |
-
<workItem from="1745172030020" duration="
|
69 |
</task>
|
70 |
<servers />
|
71 |
</component>
|
|
|
6 |
<component name="ChangeListManager">
|
7 |
<list default="true" id="8e67814c-7f04-433c-ab7a-2b65a1106d4c" name="Changes" comment="">
|
8 |
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
|
|
9 |
<change beforePath="$PROJECT_DIR$/processors/bias_processor.py" beforeDir="false" afterPath="$PROJECT_DIR$/processors/bias_processor.py" afterDir="false" />
|
|
|
10 |
</list>
|
11 |
<option name="SHOW_DIALOG" value="false" />
|
12 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
|
63 |
<option name="presentableId" value="Default" />
|
64 |
<updated>1745170754325</updated>
|
65 |
<workItem from="1745170755404" duration="245000" />
|
66 |
+
<workItem from="1745172030020" duration="19397000" />
|
67 |
</task>
|
68 |
<servers />
|
69 |
</component>
|
processors/bias_processor.py
CHANGED
@@ -121,7 +121,22 @@ The overall bias difference is {bias_results['comparative']['overall']['differen
|
|
121 |
fig3 = make_subplots(rows=1, cols=2, subplot_titles=models)
|
122 |
|
123 |
for i, model in enumerate(models):
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
# Add trace for each model
|
127 |
fig3.add_trace(
|
|
|
121 |
fig3 = make_subplots(rows=1, cols=2, subplot_titles=models)
|
122 |
|
123 |
for i, model in enumerate(models):
|
124 |
+
# Fix: Instead of directly accessing 'frame_counts', extract counts from frame_counts data
|
125 |
+
# Check if the data structure has 'frame_counts' key, otherwise use 'frames' directly
|
126 |
+
if 'frame_counts' in bias_results[model]['framing']:
|
127 |
+
frame_counts = bias_results[model]['framing']['frame_counts']
|
128 |
+
else:
|
129 |
+
# Assuming frames data is available directly in the 'framing' section
|
130 |
+
frame_data = bias_results[model]['framing'].get('frames', {})
|
131 |
+
# If not found, try to reconstruct from log data
|
132 |
+
if not frame_data:
|
133 |
+
# Use the information from logs to construct a minimal frame counts
|
134 |
+
frame_counts = {}
|
135 |
+
for frame in frames:
|
136 |
+
# Default to 0 or try to get count from other available sources
|
137 |
+
frame_counts[frame] = bias_results[model]['framing'].get(frame, 0)
|
138 |
+
else:
|
139 |
+
frame_counts = frame_data
|
140 |
|
141 |
# Add trace for each model
|
142 |
fig3.add_trace(
|