Skip to content

Stone-bridge-NLP/embedding_layer

Repository files navigation

Embedding layer

Genre classification by lyrics using keras Embedding layer


Code

  • main.ipynb : Genre classification by lyrics with keras Embedding layer and LSTM layer Open In Colab

Result

1. Use unbalanced train data

Genre plot

download

accuracy & loss

download download

F1-score

              precision    recall  f1-score   support

     Hip-Hop       0.00      0.00      0.00       960
       Indie       0.00      0.00      0.00       510
       Metal       0.58      0.59      0.58       810
         Pop       0.22      0.44      0.30      1110
     Country       0.00      0.00      0.00       810
        Jazz       0.58      0.26      0.36       659
        Rock       0.24      0.77      0.36      1410
         R&B       0.00      0.00      0.00       509
  Electronic       0.00      0.00      0.00       659
        Folk       0.26      0.04      0.06       495

    accuracy                           0.28      7932
   macro avg       0.19      0.21      0.17      7932
weighted avg       0.20      0.28      0.20      7932

2. Use balanced train data

Genre plot

download

accuracy & loss

download download

F1-score

              precision    recall  f1-score   support

     Hip-Hop       0.55      0.66      0.60       960
       Indie       0.14      0.14      0.14       510
       Metal       0.35      0.42      0.38       810
         Pop       0.18      0.02      0.04      1110
     Country       0.32      0.34      0.33       810
        Jazz       0.28      0.31      0.29       659
        Rock       0.22      0.12      0.16      1410
         R&B       0.12      0.21      0.15       509
  Electronic       0.13      0.20      0.16       659
        Folk       0.15      0.26      0.19       495

    accuracy                           0.26      7932
   macro avg       0.24      0.27      0.24      7932
weighted avg       0.26      0.26      0.25      7932

3. Use balanced train data & drop out, normalization

accuracy & loss

download download

F1-score

              precision    recall  f1-score   support

     Hip-Hop       0.63      0.72      0.67       960
       Indie       0.11      0.35      0.17       510
       Metal       0.43      0.63      0.51       810
         Pop       0.27      0.08      0.12      1110
     Country       0.31      0.34      0.32       810
        Jazz       0.24      0.29      0.26       659
        Rock       0.26      0.03      0.06      1410
         R&B       0.13      0.26      0.18       509
  Electronic       0.17      0.10      0.13       659
        Folk       0.15      0.14      0.15       495

    accuracy                           0.28      7932
   macro avg       0.27      0.29      0.26      7932
weighted avg       0.29      0.28      0.26      7932

Reference

About

use embedding layer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published