<commit_before>var config = {
      "numWordsInNgram": 1,
      "trainingSize":    process.argv[2] || 1000
    },
    trainingData = {
      "pos": require("./data/Positive_Promts_TS").data,
      "neg": require('./data/Negavite_Promts_FML').data
    },
    classify = {
      "nbc": require("./classifier/nbc"),
      "kss": require("./classifier/kss")
    },
    twitterUserInfo = require("./twitterUserInfo"),
    twit = new (require("./node-twitter"))(twitterUserInfo);
    docUtils = require("./utils/document");

twit.action = "sample";
// Limit training data to the training size specified
trainingData.pos.splice(config.trainingSize);
trainingData.neg.splice(config.trainingSize);

twit.stream('statuses/sample', function(stream) {
  stream.on('data', function (tweet) {
    // For some reason some tweets don't contain a tweet. Should probably investigate.
    if (tweet.text === undefined) return;

    var twssProbability = classify.nbc.getTwssProbability({
      "threshold":       0.99,
      "promt":           tweet.text,
      "trainingData":    trainingData,
      "numWordsInNgram": config.numWordsInNgram
    });

    if (classify.nbc.isTwss({ "twssProbability": twssProbability }))
      console.log(twssProbability + '\n' + tweet.text + '\n');
  });
});<commit_msg>Relocated the threshold option<commit_after>var config = {
      "numWordsInNgram": 1,
      "trainingSize":    process.argv[2] || 1000
    },
    trainingData = {
      "pos": require("./data/Positive_Promts_TS").data,
      "neg": require('./data/Negavite_Promts_FML').data
    },
    classify = {
      "nbc": require("./classifier/nbc"),
      "kss": require("./classifier/kss")
    },
    twitterUserInfo = require("./twitterUserInfo"),
    twit = new (require("./node-twitter"))(twitterUserInfo);
    docUtils = require("./utils/document");

twit.action = "sample";
// Limit training data to the training size specified
trainingData.pos.splice(config.trainingSize);
trainingData.neg.splice(config.trainingSize);

twit.stream('statuses/sample', function(stream) {
  stream.on('data', function (tweet) {
    // For some reason some tweets don't contain a tweet. Should probably investigate.
    if (tweet.text === undefined) return;

    var twssProbability = classify.nbc.getTwssProbability({
      "promt":           tweet.text,
      "trainingData":    trainingData,
      "numWordsInNgram": config.numWordsInNgram
    });

    if (classify.nbc.isTwss({ "twssProbability": twssProbability, "threshold": 0.99 }))
      console.log(twssProbability + '\n' + tweet.text + '\n');
  });
});
{'fraction_non_alphanumeric': 0.15987582460225067, 'fraction_numerical': 0.006984866123399301, 'mean_word_length': 3.34006734006734, 'pattern_counts': {'":': 22, '<': 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': '147501', 'n_tokens_mistral': 862, 'n_tokens_neox': 811, 'n_words': 155}