Spaces:
Sleeping
Sleeping
Dan Mo
commited on
Commit
·
0c2508d
1
Parent(s):
106b061
Refactor file paths for emoji dictionaries to use relative paths
Browse files
app.py
CHANGED
@@ -20,8 +20,11 @@ def kitchen_txt_to_dict(filepath):
|
|
20 |
emoji_dict[emoji] = desc
|
21 |
return emoji_dict
|
22 |
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
25 |
|
26 |
# Precompute embeddings
|
27 |
emotion_embeddings = {emoji: model.encode(desc) for emoji, desc in emotion_dict.items()}
|
|
|
20 |
emoji_dict[emoji] = desc
|
21 |
return emoji_dict
|
22 |
|
23 |
+
file_path_emotion = 'google-emoji-kitchen-emotion.txt'
|
24 |
+
file_path_item = 'google-emoji-kitchen-item.txt'
|
25 |
+
|
26 |
+
emotion_dict = kitchen_txt_to_dict(file_path_emotion)
|
27 |
+
event_dict = kitchen_txt_to_dict('google-emoji-kitchen-item.txt')
|
28 |
|
29 |
# Precompute embeddings
|
30 |
emotion_embeddings = {emoji: model.encode(desc) for emoji, desc in emotion_dict.items()}
|