Spaces:
Sleeping
Sleeping
File size: 655 Bytes
0eafe79 4dcc3f2 0eafe79 4dcc3f2 0eafe79 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 |
import gradio as gr
from Deliverable2 import *
import json
# Instantiate the URLValidator class
validator = URLValidator()
def validate_url(user_query, url):
result = validator.rate_url_validity(user_query, url)
return json.dumps(result, indent=2)
# Define the Gradio interface
iface = gr.Interface(
fn=validate_url,
inputs=[
gr.Textbox(label="Enter your query"),
gr.Textbox(label="Enter URL to validate")
],
outputs=gr.Textbox(label="Validation Result"),
title="URL Credibility Validator",
description="Enter a query and a URL to check its credibility and relevance."
)
# Launch the app
iface.launch()
|