Spaces:
Sleeping
Sleeping
adding metrics
Browse files
app.py
CHANGED
@@ -56,7 +56,6 @@ st.sidebar.image("logo-wordlift.png")
|
|
56 |
st.sidebar.markdown("""
|
57 |
- β
AI Assistance with Immediate Fact Verification
|
58 |
- β
Prevention of AI-Generated Misinformation
|
59 |
-
- β
Automatic Structured Data for ClaimReview
|
60 |
""")
|
61 |
|
62 |
# Main content
|
@@ -78,6 +77,7 @@ if submit_button and text_input:
|
|
78 |
claim_reviewed = inner_json.get("claimReviewed", "N/A")
|
79 |
review_rating = inner_json.get("reviewRating", {})
|
80 |
rating_value = review_rating.get("ratingValue", "N/A")
|
|
|
81 |
review_body = inner_json.get("reviewBody", "N/A")
|
82 |
|
83 |
# Display the results
|
@@ -85,9 +85,17 @@ if submit_button and text_input:
|
|
85 |
st.progress(int(rating_value) / 5, "Fact-checking in progress.")
|
86 |
else:
|
87 |
st.write("Rating Value: ", rating_value)
|
88 |
-
st.write(f"Review Body
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
else:
|
93 |
st.error("Error in fact-checking: " + api_response['error'])
|
|
|
56 |
st.sidebar.markdown("""
|
57 |
- β
AI Assistance with Immediate Fact Verification
|
58 |
- β
Prevention of AI-Generated Misinformation
|
|
|
59 |
""")
|
60 |
|
61 |
# Main content
|
|
|
77 |
claim_reviewed = inner_json.get("claimReviewed", "N/A")
|
78 |
review_rating = inner_json.get("reviewRating", {})
|
79 |
rating_value = review_rating.get("ratingValue", "N/A")
|
80 |
+
alternate_name = review_rating.get("alternateName", "N/A") # Extract the alternateName
|
81 |
review_body = inner_json.get("reviewBody", "N/A")
|
82 |
|
83 |
# Display the results
|
|
|
85 |
st.progress(int(rating_value) / 5, "Fact-checking in progress.")
|
86 |
else:
|
87 |
st.write("Rating Value: ", rating_value)
|
88 |
+
st.write(f"<b>Review Body</b>: {review_body}")
|
89 |
+
|
90 |
+
# Create a two-column layout
|
91 |
+
col1, col2 = st.columns(2)
|
92 |
+
|
93 |
+
# Use the metric widget to display the rating and alternate name
|
94 |
+
col1.metric("Rating", rating_value)
|
95 |
+
col2.metric("Verdict", alternate_name)
|
96 |
+
|
97 |
+
#with st.expander("Here is the final JSON-LD"):
|
98 |
+
# st.json(inner_json) # Display the entire JSON-LD data
|
99 |
|
100 |
else:
|
101 |
st.error("Error in fact-checking: " + api_response['error'])
|