Test / app.py
Adityadn's picture
Update app.py
a1ba501 verified
raw
history blame
990 Bytes
import gradio as gr
lopek = ["I Love You", "Ilopyu", "I <3 U", "Ai lof yu", "Lop yu"]
sangean = ["Ah", "Ahh"]
gajelas = ["`", "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", "0", "-", "_", "=", "+", "[", "{", "]", "}", ";", ':', "'", ",", "<", ".", ">", "/", "?"]
def analyze_text(text):
# Lakukan analisis atau pemrosesan teks di sini
if text == "":
result = "MASUKKIN THE TEXT IDIOT"
elif text in lopek:
result = "Love you too...."
elif text in sangean:
result = "You is sangean"
elif text in gajelas:
result = "GAJELAS IDIOT"
else:
result = f"You memasukkan text: {text}"
return result
iface = gr.Interface(
fn=analyze_text,
inputs=gr.Textbox(label="Input", placeholder="Enter Text Here", show_copy_button=True), # Menggunakan input textbox
outputs=gr.Textbox(type="text", label="Output", show_copy_button=True), # Menetapkan output ke tipe teks
show_footer=False
)
iface.launch(show_api=False)