Giter Club home page Giter Club logo

twss.js's Introduction

This is a node.js module that classifies if a sentence can be replied with "that's what she said".

Installation

npm install twss

Usage

var twss = require('twss');

twss.is("Nice weather we're having today"); // false
twss.is("Can you make it harder?");         // true
twss.is("You're not going fast enough!");   // true

Settings

twss.algo

You change algorithm from the default naive bayes classifier (nbc) to a k-nearest neighbor algorithm (knn).

twss.algo = 'nbc';
twss.algo = 'knn';

twss.threshold

If you want more obscure jokes to be accepted, you can set the "probability the sentence can be replied with twss" threshold. Be aware that a too low threshold may result in a lot of false-positives, and a too high threshold may result in a lot of false-negatives.

twss.threshold = 0.5;
twss.is("You're hardly my first."); // false

twss.threshold = 0.3;
twss.is("You're hardly my first."); // true

Additional functions

twss.probability

If you'd just like the probability that a sentence can be replied with "That's what she said" you can use the twss.probability function.

twss.probability("Behold, I come quickly."); // 0.956323045469951

Or just use the alias twss.prob

twss.prob("The juice keeps coming out of the wrong hole!") // 0.9961630818418142

twss.js's People

Contributors

danielrapp avatar floby avatar karbassi avatar thomwiggers avatar twolfson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twss.js's Issues

Crowdsourcing site

This might be useful:

  • shows latest tweets with very high and very low score
  • users can click +/-
  • stuff with many votes into one direction and nearly none into the other comes into the rating DB

As it would also provide quite some entertainment, I guess you'd get enough users for this. :)

CLI utility

adding the possibiliy to use twss in a terminal environment could be interesting and would be easier to integrate with other programs.
I'm willing to send a pull request if I can find some time to do it.

Short sentences biased

Short sentences trigger relentlessly. I.e. "oh wow lol", "oh god", "oh what", "oh why", "oh, right.", "always good", "no one does", "much better", "all my want", "god damn", "OH", "oh my", "I'm in awe", "i guess", "it isn't", "ok", "aint hard" and for some reason "I will never program in java"

k-NN doesn't work at all

It just returns this error:

ReferenceError: trainingPrompt is not defined
    at Object.isTwss (/Users/Daniel/twss.js/lib/classifier/knn.js:35:7)
    at Object.is (/Users/Daniel/twss.js/lib/twss.js:49:33)
    at [object Context]:1:3
    at Interface.<anonymous> (repl.js:171:22)
    at Interface.emit (events.js:64:17)
    at Interface._onLine (readline.js:153:10)
    at Interface._line (readline.js:408:8)
    at Interface._ttyWrite (readline.js:585:14)
    at ReadStream.<anonymous> (readline.js:73:12)
    at ReadStream.emit (events.js:81:20)

Add support for polling github issues

  • poll github issues
  • on new issue:
    • calculate twss-score
    • if score > limit, reply accordingly (cool message needed!)
  • see how long it takes to be banned

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.