Spaces:
Running
Running
Krish Patel
commited on
Commit
·
c37cf7b
1
Parent(s):
21bc2b4
Enhanced frontend
Browse files
app.py
CHANGED
@@ -147,19 +147,19 @@ def main():
|
|
147 |
# In the main() function:
|
148 |
|
149 |
# Display metrics in columns
|
150 |
-
col1, col2
|
151 |
|
152 |
with col1:
|
153 |
-
st.subheader("ML Model Analysis")
|
154 |
st.metric("Prediction", ml_prediction)
|
155 |
st.metric("Confidence", f"{ml_confidence:.2f}%")
|
156 |
|
157 |
-
with col2:
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
|
162 |
-
with
|
163 |
st.subheader("Gemini Analysis")
|
164 |
gemini_pred = gemini_result["gemini_analysis"]["predicted_classification"]
|
165 |
gemini_conf = gemini_result["gemini_analysis"]["confidence_score"]
|
@@ -211,17 +211,6 @@ def main():
|
|
211 |
except Exception as e:
|
212 |
st.error("Error processing analysis results")
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
with st.expander("Named Entities"):
|
217 |
-
entities = extract_entities(news_text, nlp)
|
218 |
-
df = pd.DataFrame(entities, columns=["Entity", "Type"])
|
219 |
-
st.dataframe(df)
|
220 |
-
|
221 |
-
# Generate and display knowledge graph
|
222 |
-
fig = generate_knowledge_graph_viz(news_text, nlp, tokenizer, model)
|
223 |
-
st.plotly_chart(fig, use_container_width=True)
|
224 |
-
|
225 |
else:
|
226 |
st.warning("Please enter some text to analyze")
|
227 |
|
|
|
147 |
# In the main() function:
|
148 |
|
149 |
# Display metrics in columns
|
150 |
+
col1, col2 = st.columns(2)
|
151 |
|
152 |
with col1:
|
153 |
+
st.subheader("ML Model and Knowedge Graph Analysis")
|
154 |
st.metric("Prediction", ml_prediction)
|
155 |
st.metric("Confidence", f"{ml_confidence:.2f}%")
|
156 |
|
157 |
+
# with col2:
|
158 |
+
# st.subheader("Knowledge Graph Analysis")
|
159 |
+
# st.metric("Prediction", kg_prediction)
|
160 |
+
# st.metric("Confidence", f"{kg_confidence:.2f}%")
|
161 |
|
162 |
+
with col2:
|
163 |
st.subheader("Gemini Analysis")
|
164 |
gemini_pred = gemini_result["gemini_analysis"]["predicted_classification"]
|
165 |
gemini_conf = gemini_result["gemini_analysis"]["confidence_score"]
|
|
|
211 |
except Exception as e:
|
212 |
st.error("Error processing analysis results")
|
213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
else:
|
215 |
st.warning("Please enter some text to analyze")
|
216 |
|