Spaces:
Sleeping
Sleeping
File size: 1,169 Bytes
996aa19 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
import os
def read_poems_from_directory(directory):
poems = []
seen_files = set()
for filename in os.listdir(directory):
if filename.endswith(".txt") and filename not in seen_files:
seen_files.add(filename)
with open(os.path.join(directory, filename), 'r') as file:
poems.append(file.read())
return poems
emotion_labels_with_colors = {
"happiness": "yellow",
"sadness": "blue",
"anger": "red",
"fear": "purple",
"disgust": "green",
"surprise": "orange",
"love": "pink",
"joy": "gold",
"anxiety": "lightblue",
"contentment": "lightgreen",
"frustration": "brown",
"loneliness": "grey",
"excitement": "cyan",
"guilt": "darkred",
"shame": "darkblue",
"envy": "darkgreen",
"jealousy": "olive",
"pride": "magenta",
"gratitude": "lavender",
"empathy": "peachpuff",
"compassion": "coral",
"boredom": "beige",
"relief": "lightyellow",
"curiosity": "lightcoral",
"awe": "turquoise",
"confusion": "plum",
"nostalgia": "orchid",
"hope": "khaki",
"despair": "maroon",
"embarrassment": "salmon"
}
|