Menu

Building the Gradio Interface

Building the Gradio Interface

In this lesson, we define how the application looks and behaves from the user’s perspective. This includes specifying the input type, output format, title, and description of the app.

Code:

iface = gr.Interface(

fn=recommend_interface_html,

inputs=gr.Textbox(label="Enter Movie Title"),

outputs=gr.HTML(),

title="Hybrid Movie Recommendation System",

description="Enter a movie title (e.g., 'Toy Story') to get top recommendations."

)

The Textbox allows users to enter a movie name, while the HTML output displays the recommendation results as a table. The title and description provide context so users immediately understand what the application does. At this stage, no new machine learning logic is added—the interface simply wraps existing functionality.