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()