dil / app.py
ismetcucen's picture
Create app.py
dd091f2 verified
Raw History Blame Contribute Delete
664 Bytes
import gradio as gr
def get_antonym(word):
antonyms = {
"big": "small",
"fast": "slow",
"happy": "sad",
"hot": "cold",
"light": "dark",
"young": "old",
"good": "bad",
"strong": "weak",
"soft": "hard",
"beautiful": "ugly"
}
return antonyms.get(word.lower(), "No antonym found")
iface = gr.Interface(
fn=get_antonym,
inputs=gr.Textbox(label="Enter a word"),
outputs=gr.Textbox(label="Antonym"),
title="Antonym Finder",
description="Enter a word and get its antonym. If the antonym is not available, it will return 'No antonym found'."
)
iface.launch()