Spaces:
Running
Running
Krish Patel
commited on
Commit
Β·
7a8ca1c
1
Parent(s):
9963876
try1
Browse files
app.py
CHANGED
@@ -165,36 +165,44 @@ def main():
|
|
165 |
|
166 |
# Detailed analysis sections
|
167 |
with st.expander("View Detailed Analysis"):
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
st.
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
|
199 |
|
200 |
with st.expander("Named Entities"):
|
|
|
165 |
|
166 |
# Detailed analysis sections
|
167 |
with st.expander("View Detailed Analysis"):
|
168 |
+
try:
|
169 |
+
# Text Classification
|
170 |
+
st.subheader("π Text Classification")
|
171 |
+
text_class = gemini_result.get('text_classification', {})
|
172 |
+
st.write(f"Category: {text_class.get('category', 'N/A')}")
|
173 |
+
st.write(f"Writing Style: {text_class.get('writing_style', 'N/A')}")
|
174 |
+
st.write(f"Target Audience: {text_class.get('target_audience', 'N/A')}")
|
175 |
+
st.write(f"Content Type: {text_class.get('content_type', 'N/A')}")
|
176 |
+
|
177 |
+
# Sentiment Analysis
|
178 |
+
st.subheader("π Sentiment Analysis")
|
179 |
+
sentiment = gemini_result.get('sentiment_analysis', {})
|
180 |
+
st.write(f"Primary Emotion: {sentiment.get('primary_emotion', 'N/A')}")
|
181 |
+
st.write(f"Emotional Intensity: {sentiment.get('emotional_intensity', 'N/A')}/10")
|
182 |
+
st.write(f"Sensationalism Level: {sentiment.get('sensationalism_level', 'N/A')}")
|
183 |
+
|
184 |
+
# Entity Recognition
|
185 |
+
st.subheader("π Entity Recognition")
|
186 |
+
entities = gemini_result.get('entity_recognition', {})
|
187 |
+
st.write(f"Source Credibility: {entities.get('source_credibility', 'N/A')}")
|
188 |
+
st.write("Key People:", ", ".join(entities.get('people', ['N/A'])))
|
189 |
+
st.write("Organizations:", ", ".join(entities.get('organizations', ['N/A'])))
|
190 |
+
|
191 |
+
# Context & Claims
|
192 |
+
st.subheader("π Context & Claims")
|
193 |
+
context = gemini_result.get('context', {})
|
194 |
+
st.write("Main Narrative:", context.get('main_narrative', 'N/A'))
|
195 |
+
st.write("Key Claims:")
|
196 |
+
for claim in gemini_result.get('fact_checking', {}).get('verifiable_claims', ['N/A']):
|
197 |
+
st.write(f"β’ {claim}")
|
198 |
+
|
199 |
+
# Reasoning
|
200 |
+
st.subheader("π Analysis Reasoning")
|
201 |
+
for point in gemini_result.get('gemini_analysis', {}).get('reasoning', ['N/A']):
|
202 |
+
st.write(f"β’ {point}")
|
203 |
+
|
204 |
+
except Exception as e:
|
205 |
+
st.error("Error processing Gemini analysis results")
|
206 |
|
207 |
|
208 |
with st.expander("Named Entities"):
|