Spaces:
Runtime error
Runtime error
Added Images
Browse files- .gitattributes +1 -0
- app.py +18 -3
- images/.DS_Store +0 -0
- images/building.png +3 -0
- images/car.png +0 -0
- images/flower.png +0 -0
- images/mountain.png +0 -0
- images/tree.png +0 -0
.gitattributes
CHANGED
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
glove.6B.50d.txt filter=lfs diff=lfs merge=lfs -text
|
|
|
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
glove.6B.50d.txt filter=lfs diff=lfs merge=lfs -text
|
37 |
+
images/building.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -53,7 +53,6 @@ text_search = st.text_input("", value="")
|
|
53 |
# Load glove embeddings
|
54 |
glove_embeddings = load_glove_embeddings('glove.6B.50d.txt')
|
55 |
|
56 |
-
# Find closest word to an input word
|
57 |
if text_search:
|
58 |
input_embedding = averaged_glove_embeddings(text_search, glove_embeddings)
|
59 |
cosine_sim = {}
|
@@ -65,7 +64,23 @@ if text_search:
|
|
65 |
|
66 |
st.write("(My search uses glove embeddings)")
|
67 |
st.write("Closest word I have between flower, mountain, tree, car and building for your input is: ")
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
st.write("")
|
70 |
-
|
71 |
|
|
|
53 |
# Load glove embeddings
|
54 |
glove_embeddings = load_glove_embeddings('glove.6B.50d.txt')
|
55 |
|
|
|
56 |
if text_search:
|
57 |
input_embedding = averaged_glove_embeddings(text_search, glove_embeddings)
|
58 |
cosine_sim = {}
|
|
|
64 |
|
65 |
st.write("(My search uses glove embeddings)")
|
66 |
st.write("Closest word I have between flower, mountain, tree, car and building for your input is: ")
|
67 |
+
word = gold_words[sorted_cosine_sim[0][0]]
|
68 |
+
if word == "flower":
|
69 |
+
st.subheader(word)
|
70 |
+
st.image('images/flower.png', width=200)
|
71 |
+
elif word == "mountain":
|
72 |
+
st.subheader(word)
|
73 |
+
st.image('images/mountain.png', width=200)
|
74 |
+
elif word == "tree":
|
75 |
+
st.subheader(word)
|
76 |
+
st.image('images/tree.png', width=200)
|
77 |
+
elif word == "car":
|
78 |
+
st.subheader(word)
|
79 |
+
st.image('images/car.png', width=200)
|
80 |
+
else:
|
81 |
+
st.subheader(word)
|
82 |
+
st.image('images/building.png', width=200)
|
83 |
+
|
84 |
st.write("")
|
85 |
+
|
86 |
|
images/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
images/building.png
ADDED
![]() |
Git LFS Details
|
images/car.png
ADDED
![]() |
images/flower.png
ADDED
![]() |
images/mountain.png
ADDED
![]() |
images/tree.png
ADDED
![]() |