Spaces:
Sleeping
Sleeping
File size: 1,521 Bytes
0eafe79 bd6448d 4dcc3f2 bd6448d 4dcc3f2 bd6448d 4dcc3f2 bd6448d 4dcc3f2 bd6448d 0eafe79 bd6448d 4dcc3f2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
import gradio as gr
from deliverable2 import *
import json
# Instantiate the URLValidator class
validator = URLValidator()
# Define the function for the Gradio app
def validate_url(query, url):
result = validator.rate_url_validity(query, url)
return json.dumps(result, indent=2)
# Define multiple queries and URLs
queries_urls = [
("Climate change effects", "https://www.nationalgeographic.com/environment/article/climate-change-overview"),
("COVID-19 vaccine effectiveness", "https://www.cdc.gov/coronavirus/2019-ncov/vaccines/effectiveness.html"),
("Latest AI advancements", "https://www.technologyreview.com/topic/artificial-intelligence"),
("Stock market trends", "https://www.bloomberg.com/markets"),
("Healthy diet tips", "https://www.healthline.com/nutrition/healthy-eating-tips"),
("Space exploration missions", "https://www.nasa.gov/missions"),
("Electric vehicle benefits", "https://www.tesla.com/benefits"),
("History of the internet", "https://www.history.com/topics/inventions/history-of-the-internet"),
("Python programming tutorials", "https://realpython.com"),
("Mental health awareness", "https://www.who.int/news-room/fact-sheets/detail/mental-health-strengthening-our-response")
]
# Create a Gradio interface
iface = gr.Interface(
fn=validate_url,
inputs=["text", "text"],
outputs="text",
title="URL Credibility Validator",
description="Enter a query and a URL to check its credibility."
)
# Launch the Gradio app
iface.launch()
|