SaiKumar1627 commited on
Commit
6734e1b
·
verified ·
1 Parent(s): dd493b7

Update deliverable2.py

Browse files
Files changed (1) hide show
  1. 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
- def rate_url_validity(user_query: str, url: str) -> dict:
83
- """ Main function to evaluate the validity of a webpage. """
84
- content = fetch_page_content(url)
85
 
86
- # Handle errors by returning a valid dictionary
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": { # ✅ Always return a valid "raw_score" dictionary
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,