SLAYEROFALL3050 commited on
Commit
6a9646d
·
1 Parent(s): 0acf3b9
Files changed (2) hide show
  1. app.py +9 -2
  2. tag_map.json +0 -72
app.py CHANGED
@@ -1,15 +1,21 @@
 
1
  import streamlit as st
2
  from streamlit_tags import st_tags
 
 
3
  import json
4
 
 
 
 
5
 
6
- f = open('tag_map.json') # OPEN JSON FILE
7
 
8
  data = json.load(f) # LOAD DATA
9
 
10
  f.close() # CLOSE FILE
11
 
12
- # --------------------------- VARIABLES
13
 
14
  # SPLIT DATA
15
  GENRE_TAGS = data['genre']
@@ -71,4 +77,5 @@ else:
71
  if st.button("Submit Tags"):
72
  st.write("Tags are:")
73
  input = genre + mood + instrument
 
74
  st.write(str(input))
 
1
+ # STREAMLIT STUFF
2
  import streamlit as st
3
  from streamlit_tags import st_tags
4
+
5
+ # PYHTON STUFF
6
  import json
7
 
8
+ # CUSTOM
9
+ from NLP.nlp import get_nearest_tags as nlp_tags
10
+
11
 
12
+ f = open('NLP/tags.json') # OPEN JSON FILE
13
 
14
  data = json.load(f) # LOAD DATA
15
 
16
  f.close() # CLOSE FILE
17
 
18
+ # --------------------------- VARIABLES / MACROS
19
 
20
  # SPLIT DATA
21
  GENRE_TAGS = data['genre']
 
77
  if st.button("Submit Tags"):
78
  st.write("Tags are:")
79
  input = genre + mood + instrument
80
+ input = nlp_tags(input)
81
  st.write(str(input))
tag_map.json DELETED
@@ -1,72 +0,0 @@
1
- {
2
- "genre": [
3
- "punkrock",
4
- "electronica",
5
- "soundtrack",
6
- "electronic",
7
- "electronic",
8
- "poprock",
9
- "rockandroll",
10
- "ambient",
11
- "electropop",
12
- "house",
13
- "r&b",
14
- "dance",
15
- "folkpop",
16
- "lounge",
17
- "trance",
18
- "progressive",
19
- "classical",
20
- "electronica",
21
- "rap",
22
- "techno",
23
- "alternative",
24
- "instrumentalhiphop"
25
- ],
26
- "mood": [
27
- "dreamy",
28
- "emotional",
29
- "film",
30
- "energetic",
31
- "inspirational",
32
- "love",
33
- "melancholic",
34
- "relaxed",
35
- "sad",
36
- "romantic",
37
- "hopeful",
38
- "motivational",
39
- "happy",
40
- "sports",
41
- "children",
42
- "trailer",
43
- "joyful",
44
- "christmas",
45
- "epic",
46
- "dark",
47
- "scifi",
48
- "festive"
49
- ],
50
- "instrument": [
51
- "synthesizer",
52
- "drums",
53
- "strings",
54
- "guitar",
55
- "piano",
56
- "saxophone",
57
- "beat",
58
- "violin",
59
- "bell",
60
- "percussion",
61
- "choir",
62
- "pad",
63
- "flute",
64
- "electricguitar",
65
- "keyboard",
66
- "horn",
67
- "bongo",
68
- "accordion",
69
- "bass",
70
- "clavier"
71
- ]
72
- }