<commit_before>"use strict"

var natural = require('natural');

var sentiment = {};

sentiment.NaiveBayes = function(data) {

    var sensation = new natural.BayesClassifier();

    sensation.addDocument('happy birthday', 'positive')
    sensation.addDocument('terribly sorry', 'negative')
    sensation.addDocument('amazingly well', 'positive')
    sensation.addDocument('awful destruction', 'negative')
    sensation.addDocument('wonderful suprise', 'positive')

    sensation.train();

    console.log(sensation.classify(data));
}


module.exports = sentiment;<commit_msg>Added some test data for NaiveBayes<commit_after>"use strict"

var natural = require('natural');

var sentiment = {};

sentiment.NaiveBayes = function(data) {

    var sensation = new natural.BayesClassifier();

    // Add some test data
    sensation.addDocument('happy birthday', 'positive')
    sensation.addDocument('terribly sorry', 'negative')
    sensation.addDocument('amazingly well', 'positive')
    sensation.addDocument('awful destruction', 'negative')
    sensation.addDocument('wonderful suprise', 'positive')
    sensation.addDocument('deadly war', 'negative')

    sensation.train();

    console.log(sensation.classify(data));
}


module.exports = sentiment;
{'fraction_non_alphanumeric': 0.136, 'fraction_numerical': 0.0, 'mean_word_length': 5.043478260869565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1424729', 'n_tokens_mistral': 360, 'n_tokens_neox': 351, 'n_words': 75}