Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -70,3 +70,78 @@ iface = gr.Interface(
|
|
70 |
)
|
71 |
|
72 |
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
)
|
71 |
|
72 |
iface.launch()
|
73 |
+
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
+
import streamlit as st
|
82 |
+
|
83 |
+
# Dataset
|
84 |
+
examples = [
|
85 |
+
[
|
86 |
+
"The power struggle between the papacy and secular authority in the medieval ages is as unimportant to me as a drop of water in the ocean. (simile)",
|
87 |
+
"growth",
|
88 |
+
],
|
89 |
+
[
|
90 |
+
"Contemplating my future feels like being engulfed by the urge to escape to a secluded island, forever. (metaphor)",
|
91 |
+
"optimism",
|
92 |
+
],
|
93 |
+
[
|
94 |
+
"Who would have thought that uniting three different grades from two different schools would be as tough as nailing jelly to a wall? (simile)",
|
95 |
+
"thankfulness",
|
96 |
+
],
|
97 |
+
[
|
98 |
+
"Her laughter was like the tinkling of silver bells, filling the room with joy. (simile)",
|
99 |
+
"happiness",
|
100 |
+
],
|
101 |
+
[
|
102 |
+
"The thunder roared and boomed, striking fear in the hearts of those who heard it. (onomatopoeia)",
|
103 |
+
"courage",
|
104 |
+
],
|
105 |
+
]
|
106 |
+
|
107 |
+
language_features = [
|
108 |
+
"Metaphor",
|
109 |
+
"Simile",
|
110 |
+
"Onomatopoeia",
|
111 |
+
"Alliteration",
|
112 |
+
"Assonance",
|
113 |
+
"Hyperbole",
|
114 |
+
"Personification",
|
115 |
+
"Oxymoron",
|
116 |
+
"Paradox",
|
117 |
+
"Pun",
|
118 |
+
"Irony",
|
119 |
+
"Sarcasm",
|
120 |
+
"Allusion",
|
121 |
+
"Imagery",
|
122 |
+
"Symbolism",
|
123 |
+
"Anaphora",
|
124 |
+
"Epistrophe",
|
125 |
+
"Parallelism",
|
126 |
+
"Euphemism",
|
127 |
+
"Synecdoche",
|
128 |
+
]
|
129 |
+
|
130 |
+
# Streamlit app
|
131 |
+
st.title("Language Feature Emoji Reference")
|
132 |
+
|
133 |
+
# Table of buttons
|
134 |
+
table_data = [language_features[i:i + 3] for i in range(0, len(language_features), 3)]
|
135 |
+
|
136 |
+
for row in table_data:
|
137 |
+
row_buttons = st.beta_columns(len(row))
|
138 |
+
for i, feature in enumerate(row):
|
139 |
+
if row_buttons[i].button(feature):
|
140 |
+
for example in examples:
|
141 |
+
if feature.lower() in example[0]:
|
142 |
+
st.write(f"**{feature}:** {example[0]}")
|
143 |
+
st.write(f"**Emoji:** {example[1]}")
|
144 |
+
st.write("---")
|
145 |
+
|
146 |
+
|
147 |
+
|