Skip to content

Commit

Permalink
Created a word cloud and added the image to app landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiag committed May 26, 2021
1 parent 8df7fad commit baf6310
Show file tree
Hide file tree
Showing 10 changed files with 524,473 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/home/rhia/.local/share/virtualenvs/spotify-dyl9WmTt/bin/python"
}
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ dash-bootstrap-components = "*"
tensorflow = "*"
sklearn = "*"
flask-sqlalchemy = "*"
ipykernel = "*"
wordcloud = "*"

[dev-packages]

Expand Down
254 changes: 242 additions & 12 deletions Pipfile.lock

Large diffs are not rendered by default.

Binary file added __pycache__/app.cpython-38.pyc
Binary file not shown.
Binary file added __pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added assets/cloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions pages/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@

column2 = dbc.Col(
[
dcc.Graph(figure=fig),
#dcc.Graph(figure=fig),

]
)

column3 = dbc.Col(
[
#dcc.Graph(figure=fig),
html.Div(html.Img(src=app.get_asset_url('cloud.png')), style={'height':'100%', 'width':'100%'})
]
)

layout = dbc.Row([column1, column2])
layout = dbc.Row([column1, column2, column3])
7 changes: 4 additions & 3 deletions pages/predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from models import spotify
import matplotlib.pyplot as plt

encodings = joblib.load(r'assets\encoded_data.joblib')
knn = joblib.load(r'assets\knn.joblib')
model = load_model(r'assets\ae4')
encodings = joblib.load(r'assets/encoded_data.joblib')
knn = joblib.load(r'assets/knn.joblib')
model = load_model(r'assets/ae4')



Expand Down Expand Up @@ -45,6 +45,7 @@ def get_songs(indeces: 'list[int]') -> list:
),
# toy tests with no meaning other than seeing what works
F"{get_songs([0, 0])}"

],
md=4
)
Expand Down
Loading

0 comments on commit baf6310

Please sign in to comment.