-
Notifications
You must be signed in to change notification settings - Fork 1
0. Getting Started
Go to /frontend/music-sharing-network/ in the github repo and double-click music-sharing-network.xcodeproj to open the Xcode project. Select the music-sharing-network project in the sidebar, in the middle pane select Signing & Capabilities, and select a team to use when building and running the app. In the upper-left corner of the window, select a device on which to run the project. Click the run button (also in the upper left) to build and run the project on the device you selected. If you want to play the audio from a post's song, have the Spotify app downloaded on your selected mobile device and sign in to your Spotify account. If you neglect to install and/or sign in to Spotify, clicking the Spotify button next to a song will open that song on spotify.com instead.
-
Clone the github repo to the machine that you wish to run the server on.
-
Open up a new bash terminal with
backendas the current directory (cd musicsharingnetwork/backend) -
Initialize a python virtual environment (
python3 -m venv env) -
Activate your python virtual enviroment (
source env/bin/activate) -
Install the necessary dependencies (
pip install -r requirements.txt) -
Create the sentiment analysis model (
python3 sentimentanalysis/svc.py)Note: Make sure the machine has at least 200 MB of space for the sentiment analysis model.
-
Verify that the
sentimentanalysisfolder has the filemodel.savin it. -
Run the server (
python3 app.py)
A copy of the server should now be running locally at localhost:8080.
The server is currently hosted at https://backend-qjgo4vxcdq-uc.a.run.app/
To deploy any changes to the hosted server:
- navigate to the backend folder (
cd musicsharingnetwork/backend) - deploy a Cloud Run build (
gcloud builds submit --timeout=3600)
Note: To deploy these changes, you must have gclouds CLI tool set up and working properly. Your Google account must also have access to the Firebase project.
- flask
- firebase_admin
- uuid
- scikit-learn
- numpy
- spotipy
Go to /backend/sentimentanalysis/ in the github repo.
Open up a new bash terminal
Activate your Python virtual environment
Install the following libraries using pip: numpy, scikit-learn. (Alternatively, run the script called download_dependencies which is located in the main project folder)
To create the model, either download the file model.sav located in our Google Drive folder (here), or run the python script svc.py which will create and save a new model (it will be identical to the model.sav file in our Google Drive).
Now you have successfully created the model that the backend needs in order to perform sentiment analysis.