localhost's notebooks

  • metal classifier - /localhost/metal-classifier
    Last edited 7 years ago
    // Classification of metal lyrics \m/ // Classifier is trained with lyrics from Carcass, // Manowar, Slayer and Immortal. // // see https://github.com/jpwesselink/metal-classifier var natural = require('natural'); var classifier = natural .BayesClassifier .restore( JSON.parse( await require("request-promise")('https://raw.githubusercontent.com/jpwesselink/metal-classifier/master/classifiers/classifier.json') ) ); [ 'kill it with fire', 'consume the blood', 'dark spirits will come for my soul', 'spirit of victory', 'war is eternal', 'cold of winter' ] .map(function(sentence){ return [ sentence, '-', classifier .classify(sentence) .toUpperCase() ] .join(' '); });