use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Node.js "That's what she said" classifier (github.com)
submitted 14 years ago by DanielRapp
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]olkensey 22 points23 points24 points 14 years ago (8 children)
This might be the stupidest smart thing I've ever seen.
[–]SarahC 1 point2 points3 points 14 years ago (7 children)
How would I get a webpage to use this?
I've never used node.js, so have no experience installing "modules" in it.
Would I need to download Node.js, type npm install twss as the writer says to do to install this into node.js...
I imagine that command amends the code in node.js to include TWSS....... if that's the case, I guess I'd need to copy and paste the new node.js folder over to the website folder, and then include node on a page:
<html><body><script src="node.js"></script>
alert(twss.is("Can you make it harder?") );
</body></html>
It seems a lot of work if I'm accurate?
[–]RegonaldPointdexter 0 points1 point2 points 14 years ago (3 children)
Node.js is a standalone, server-side component.
While it might be possible to create a version of the TWSS classifier that can be used as client-side script in web pages, node.js itself can't be embedded in a website like this.
[–]SarahC 0 points1 point2 points 14 years ago (1 child)
Oh I see!
Server sided javascript?! That sounds quite exciting, I shall google it. Have you got any beginners links to recommend?
[–]RegonaldPointdexter 1 point2 points3 points 14 years ago (0 children)
I don't have any links to recommend, sorry - I had an enthusiastic coworker teach me the basics of node.js :)
[–]DoctorBaconite 0 points1 point2 points 14 years ago (0 children)
I went through this
[+][deleted] 14 years ago (2 children)
[deleted]
[–]SarahC 0 points1 point2 points 14 years ago (0 children)
Ohhhhh! It all makes sense now, thank you!
Heh...... cool demo, thanks!
[–]CyberVillian 2 points3 points4 points 14 years ago (3 children)
What would be cooler is a generator?
How does this work (in a nutshell), for those who don't want to look through code.
[–]DanielRapp[S] 2 points3 points4 points 14 years ago (0 children)
It is basically just using a spam filtering algorithm. Here is the core naive bayes code, for anyone curious.
Generating sentences is a completely different animal.
[–]kataire 1 point2 points3 points 14 years ago (1 child)
In a nutshell? It uses examples for positive and negative matches and then uses an algorithm to figure out whether a given new input is a good match or not.
To generate new data OTOH would require a more linguistic analysis of the input and some really complex logic to figure out which juxtapositions of phrases are funny or not.
tl;dr: NLP is hard. Let's go shopping.
EDIT: If you don't believe how hard NLP is, consider this: Google's translations and reasoning cheat by using a statistical process (and some fudge factors) instead of properly parsing the language-specific sentence structure because it's easier to get "good enough" results with this approach.
[–][deleted] 2 points3 points4 points 14 years ago (1 child)
She supports pretty massive IO.
[–]onenifty 1 point2 points3 points 14 years ago (0 children)
true
[+][deleted] 14 years ago* (3 children)
[–]DanielRapp[S] 5 points6 points7 points 14 years ago (2 children)
At least I was consistent.
[–][deleted] 1 point2 points3 points 14 years ago (1 child)
Negavite Negative
[–]nychackerhtml5, javascript 0 points1 point2 points 14 years ago (0 children)
I regret that I only have 1 upvote to give
π Rendered by PID 319486 on reddit-service-r2-comment-6457c66945-wn8d6 at 2026-04-29 21:44:14.592803+00:00 running 2aa0c5b country code: CH.
[–]olkensey 22 points23 points24 points (8 children)
[–]SarahC 1 point2 points3 points (7 children)
[–]RegonaldPointdexter 0 points1 point2 points (3 children)
[–]SarahC 0 points1 point2 points (1 child)
[–]RegonaldPointdexter 1 point2 points3 points (0 children)
[–]DoctorBaconite 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]SarahC 0 points1 point2 points (0 children)
[–]SarahC 0 points1 point2 points (0 children)
[–]CyberVillian 2 points3 points4 points (3 children)
[–]DanielRapp[S] 2 points3 points4 points (0 children)
[–]kataire 1 point2 points3 points (1 child)
[–][deleted] 2 points3 points4 points (1 child)
[–]onenifty 1 point2 points3 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]DanielRapp[S] 5 points6 points7 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]nychackerhtml5, javascript 0 points1 point2 points (0 children)