Sentiment classification using qminer. Trains a support vector machine classifier.
Import libraries: the main library qminer and a helper package for the example dataset.
var qm = require('qminer-try'); // temporary, will soon be replaced with require('qminer')!
var loader = require('qminer-data-loader');
'loaded'
Define the storage schema. We define one store called 'tweets' where each record has two fields: text and target (+1 is for positive sentiment and -1 for negative sentiment).
var base = new qm.Base({
mode: 'createClean',
schema: [{ name: 'tweets',
fields: [{ name: 'text', type: 'string' },
{ name: 'target', type: 'float' }]
}]
});
'defined schema'