emoji-meaning / app.py
ehristoforu's picture
Update app.py
46785de
raw
history blame
794 Bytes
import gradio as gr
import json
with open("emoji_meanings.json", "r", encoding="utf-8") as json_file:
emoji_meanings = json.load(json_file)
def get_emoji_meaning(emoji):
return emoji_meanings.get(emoji, "Emoticon meaning not found")
examples = [
"😎",
"🀩",
"πŸ₯΅",
"πŸ₯Ά",
"😺",
"🀝",
"🎺",
]
iface = gr.Interface(
fn=get_emoji_meaning,
inputs=gr.Textbox(label="Emoji Input", max_lines=1, interactive=True),
outputs=gr.Textbox(label="Emoji Meaning", max_lines=2, lines=1, show_copy_button=True, interactive=False),
title="Emoji Meaning",
description="⚠️ This is a test version, so not all emojis have meanings here!",
examples=examples,
theme="zenafey/prodia-web",
live=True,
)
iface.launch(show_api=False)