3 ms·
Couldn't agree more! Recently I wrote a web-extension for Firefox that displays funny "Deep thought" quotes. I wanted to analyse the quote text and fetch rele
by cvs268 9y ago
Couldn't agree more!
Recently I wrote a web-extension for Firefox that displays funny "Deep thought" quotes.
I wanted to analyse the quote text and fetch relevant images to animate in the background of the quote text. After reading several NLP tutorials, guess what I did as a first PoC - Pick the 3 longest words in a quote text and run an image search with those 3 words.
6 lines of plain javascript code that can be run anywhere almost instantly
https://github.com/TheCodeArtist/deep-thought-tabs/blob/master/addon-src/deepThoughts.js#L87 https://github.com/TheCodeArtist/deep-thought-tabs/blob/mast...
I get relevant images in the search results 99/100 times. The quirks of searching often result in the image adding to the funny-ness of the "Deep Thought" on display.
Its so effective that i ended up publishing the "Deep Thought Tabs" web-extension with this approach itself:
https://addons.mozilla.org/en-US/android/addon/deep-thought-tabs/ https://addons.mozilla.org/en-US/android/addon/deep-thought-...
Later I tried using the nlp-compromise js library to identify "topics" of interest within a quote text - typically nouns, verbs, and adjectives. Comparing the results with my "3-longest-words" approach, I found that the longest words were anyways almost always the "topic" words that NLP identified for any given quote text.
- boxy310 9y agoNeat observation. The "3-longest-words" approach probably works well because grammatical words tend to be elided down to as short of an implementation as possible, while longer words tend to be more demonstrative of the actual topic at hand, rather than grammatical structure.
- vvanders 9y agoThat's pretty awesome. Back in games we'd do all sorts of tricks in networking to make it look like things were happening(sound effects, decals, etc) in response to local events until we could have the server provide the definitive call on some game state. Most players thought we had a much higher fidelity sim then we actually did. It's a pretty common technique across a lot of games. You can get away with quite a bit by being smart about what you "fake" and what you actually make work end-to-end.