import gradio as gr def classify_transaction(notes, merchant): # Placeholder for your model's classification logic # Replace this with the actual call to your model and return the result return f"Predicted Category: [Your Model's Output]" # List of merchants for the dropdown merchants = ['Merchant A', 'Merchant B', 'Merchant C', ...] # Creating the Gradio interface iface = gr.Interface( fn=classify_transaction, inputs=[ gr.inputs.Textbox(lines=3, placeholder="Enter Transaction Notes Here", label="Transaction Notes"), gr.inputs.Dropdown(choices=merchants, label="Merchant Name") ], outputs=gr.outputs.Text(label="Classification Result"), title="Transaction Category Classifier", description="This tool classifies transaction categories based on notes and merchant names.", theme="huggingface", # Using a predefined theme for a polished look layout="vertical" # Arrange inputs and output vertically ) if __name__ == "__main__": iface.launch()