Code Monkey home page Code Monkey logo

ouvido_musical-back's Introduction

Ouvido Musical Back End

Código do artigo "Explorando os metadados na recomendação de músicas em um ambiente com escassez de informação" publicado na Revista Brasileira de Computação Aplicada. Link do artigo: http://seer.upf.br/index.php/rbca/article/view/10047

Monografia sob o nome de "OUVIDO MUSICAL: EXPLORANDO METADADOS EM UM SISTEMA DERECOMENDAÇÃO DE MÚSICAS" foi publicada no repositorio da Universidade Federal da Bahia e pode ser encontrado em: https://repositorio.ufba.br/ri/handle/ri/29739

Instalação

  1. Atualização do Ubuntu: sudo apt update && sudo apt upgrade -y
  2. Instalação do Pip 3 e Postgres: sudo apt install python3-pip python3-dev python3-venv libpq-dev postgresql postgresql-contrib build-essential libssl-dev libffi-dev zip unzip
  3. Instale a Virtual Environment: sudo pip3 install virtualenv

Configuração

  1. Criando a Virtual Env local: virtualenv venv
  2. Inicie a Virtual Env: source venv/bin/activate
  3. Carregue os arquivos no requirements: pip install -r requirements.txt
  4. Acesse o Python: python
    4.1. Importe o nltk: import nltk
    4.2. Baixe a base de palavras: nltk.download('wordnet')
    4.3. Baixe a base de palavras: nltk.download('punkt')
    4.4. exit()
  5. Instalando os modulos: pip install requirements.txt

O Postgres

  1. sudo -u postgres psql
  2. CREATE DATABASE ouvido_musical;
  3. CREATE USER ouvidoMusicalAPI WITH PASSWORD 'lovelovelove';
  4. ALTER ROLE ouvidoMusicalAPI SET client_encoding TO 'utf8';
  5. ALTER ROLE ouvidoMusicalAPI SET default_transaction_isolation TO 'read committed';
  6. ALTER ROLE ouvidoMusicalAPI SET timezone TO 'UTC';
  7. GRANT ALL PRIVILEGES ON DATABASE ouvidoMusical TO ouvidoMusicalAPI;
  8. \q

Migrações do banco

  1. Criando migração do banco: python manage.py makemigrations
  2. Aplicando migração ao banco: python manage.py migrate

Extraindo o dataset

  1. Descompactar o dataset: cd datasets/oneMillionSongs/ && unzip original_set.zip && cd ../../
  2. Abra o terminal do Django: python manage.py shell_plus --ipython
  3. Importe a função: from datasets.oneMillionSongs.clean_set import clean_all_files
  4. Execute a função: clean_all_files()
  5. Importe o arquivo: from datasets.oneMillionSongs.mining import main
  6. Execute a função: main()
  7. exit()

Importando o set para o Postgres

  1. Entrar no painel do banco: sudo -u postgres psql ouvido_musical
  2. Carregar os dados extraidos no banco: \i datasets/oneMillionSongs/sets/{pasta_do_set}/load.sql;
  3. \q

ouvido_musical-back's People

Contributors

diegocorrea avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.