Spaces:
Runtime error
Runtime error
Upload app..py
Browse files
app..py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def classify_transaction(notes, merchant):
|
4 |
+
# Placeholder for your model's classification logic
|
5 |
+
# Replace this with the actual call to your model and return the result
|
6 |
+
return f"Predicted Category: [Your Model's Output]"
|
7 |
+
|
8 |
+
# List of merchants for the dropdown
|
9 |
+
merchants = ['Merchant A', 'Merchant B', 'Merchant C', ...]
|
10 |
+
|
11 |
+
# Creating the Gradio interface
|
12 |
+
iface = gr.Interface(
|
13 |
+
fn=classify_transaction,
|
14 |
+
inputs=[
|
15 |
+
gr.inputs.Textbox(lines=3, placeholder="Enter Transaction Notes Here", label="Transaction Notes"),
|
16 |
+
gr.inputs.Dropdown(choices=merchants, label="Merchant Name")
|
17 |
+
],
|
18 |
+
outputs=gr.outputs.Text(label="Classification Result"),
|
19 |
+
title="Transaction Category Classifier",
|
20 |
+
description="This tool classifies transaction categories based on notes and merchant names.",
|
21 |
+
theme="huggingface", # Using a predefined theme for a polished look
|
22 |
+
layout="vertical" # Arrange inputs and output vertically
|
23 |
+
)
|
24 |
+
|
25 |
+
if __name__ == "__main__":
|
26 |
+
iface.launch()
|