Spaces:
Sleeping
Sleeping
Update deliverable2.py
Browse files- deliverable2.py +5 -5
deliverable2.py
CHANGED
@@ -79,11 +79,11 @@ class URLValidator:
|
|
79 |
|
80 |
return " ".join(reasons) if reasons else "This source is highly credible and relevant."
|
81 |
|
82 |
-
|
83 |
-
""" Main function to evaluate the validity of a webpage. """
|
84 |
-
content = fetch_page_content(url)
|
85 |
|
86 |
-
#
|
87 |
if "Error" in content:
|
88 |
return {"Validation Error": content}
|
89 |
|
@@ -103,7 +103,7 @@ class URLValidator:
|
|
103 |
explanation = generate_explanation(domain_trust, similarity_score, fact_check_score, bias_score, final_score)
|
104 |
|
105 |
return {
|
106 |
-
"raw_score": {
|
107 |
"Domain Trust": domain_trust,
|
108 |
"Content Relevance": similarity_score,
|
109 |
"Fact-Check Score": fact_check_score,
|
|
|
79 |
|
80 |
return " ".join(reasons) if reasons else "This source is highly credible and relevant."
|
81 |
|
82 |
+
def rate_url_validity(user_query: str, url: str):
|
83 |
+
""" Main function to evaluate the validity of a webpage. """
|
84 |
+
content = fetch_page_content(url) # ✅ Add a properly indented block here
|
85 |
|
86 |
+
# Handle errors
|
87 |
if "Error" in content:
|
88 |
return {"Validation Error": content}
|
89 |
|
|
|
103 |
explanation = generate_explanation(domain_trust, similarity_score, fact_check_score, bias_score, final_score)
|
104 |
|
105 |
return {
|
106 |
+
"raw_score": {
|
107 |
"Domain Trust": domain_trust,
|
108 |
"Content Relevance": similarity_score,
|
109 |
"Fact-Check Score": fact_check_score,
|