Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
from model_tools import tag_text_sample
|
4 |
+
|
5 |
+
# Initialization
|
6 |
+
|
7 |
+
# Test for session states
|
8 |
+
if 'predictions' not in st.session_state:
|
9 |
+
st.session_state['predictions'] = False
|
10 |
+
|
11 |
+
st.title("The auto emoji suggestion ๐๐")
|
12 |
+
st.write("""Emoji (Semantic) Search
|
13 |
+
Super-awesome semantic search for emojis, allowing you to find emojis for any situation,
|
14 |
+
like when youโre hungry and need an emoji-inspired meal plan for the month.
|
15 |
+
just emojis hungry
|
16 |
+
๐ฒ ๐ฅซ ๐ฝ๏ธ ๐ ๐ฅฃ ๐ซ ๐ซ ๐ฏ ๐ ๐งโ๐ผ ๐ฅฎ ๐ญ
|
17 |
+
""")
|
18 |
+
|
19 |
+
|
20 |
+
text_input = st.text_input("Enter your sentence here", "so hungry")
|
21 |
+
|
22 |
+
|
23 |
+
if st.button('submit sentence') or text_input:
|
24 |
+
|
25 |
+
with st.spinner("Starting emoji prediction .."):
|
26 |
+
output = tag_text_sample(text_input)
|
27 |
+
st.success(output)
|
28 |
+
st.balloons()
|