Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,7 +37,6 @@ def predict_sport_class(sentence):
|
|
| 37 |
predicted_class = label_mapping[predicted_label]
|
| 38 |
return predicted_class
|
| 39 |
|
| 40 |
-
# Define examples
|
| 41 |
examples = [
|
| 42 |
["The team won the championship in a thrilling match!"],
|
| 43 |
["The stock market saw a significant drop today."],
|
|
@@ -46,7 +45,15 @@ examples = [
|
|
| 46 |
["The actor delivered a stellar performance in the new movie."],
|
| 47 |
]
|
| 48 |
|
| 49 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
interface = gr.Interface(
|
| 51 |
fn=predict_sport_class,
|
| 52 |
inputs=gr.Textbox(lines=2, placeholder="Enter Article here..."),
|
|
@@ -54,9 +61,9 @@ interface = gr.Interface(
|
|
| 54 |
title="Topic Classification App",
|
| 55 |
description="Enter a topic to classify it into one of the following categories: sport, business, politics, tech, entertainment.",
|
| 56 |
examples=examples,
|
| 57 |
-
|
| 58 |
)
|
| 59 |
|
| 60 |
-
#
|
| 61 |
-
interface.launch(
|
| 62 |
|
|
|
|
| 37 |
predicted_class = label_mapping[predicted_label]
|
| 38 |
return predicted_class
|
| 39 |
|
|
|
|
| 40 |
examples = [
|
| 41 |
["The team won the championship in a thrilling match!"],
|
| 42 |
["The stock market saw a significant drop today."],
|
|
|
|
| 45 |
["The actor delivered a stellar performance in the new movie."],
|
| 46 |
]
|
| 47 |
|
| 48 |
+
# Custom CSS for background color
|
| 49 |
+
custom_css = """
|
| 50 |
+
body {
|
| 51 |
+
background-color: #3b5998; /* Blue background */
|
| 52 |
+
color: white; /* Optional: Change text color to white */
|
| 53 |
+
}
|
| 54 |
+
"""
|
| 55 |
+
|
| 56 |
+
# Interface definition
|
| 57 |
interface = gr.Interface(
|
| 58 |
fn=predict_sport_class,
|
| 59 |
inputs=gr.Textbox(lines=2, placeholder="Enter Article here..."),
|
|
|
|
| 61 |
title="Topic Classification App",
|
| 62 |
description="Enter a topic to classify it into one of the following categories: sport, business, politics, tech, entertainment.",
|
| 63 |
examples=examples,
|
| 64 |
+
css=custom_css, # Apply custom CSS
|
| 65 |
)
|
| 66 |
|
| 67 |
+
# Launch the interface
|
| 68 |
+
interface.launch()
|
| 69 |
|