This is a demonstration of browser-side Natural Language Processing using a library called compromise. It extracts parts of speech from blocks of text and uses them in a Mad Libs-like story! It was presented at the BostonJS Meetup on June 6th, 2018.
(example using Moana)
This app was built with Ember.js. The most interesting files are nlp-tools.js which contains all the processing utilities, and manual.js which has an example of the data structure used by the utilties. The object defined in the model function in manual.js
maps to the variables used in the "results" layout the user sees. The template for the results is in results-display.hbs. Most other files in the app are just boilerplate.
To run the app locally, you will need the following things properly installed on your computer.
- Git
- Node.js (with npm)
- Ember CLI
- Google Chrome
You can install the ember-cli
with npm install -g ember-cli
. You'll use an ember-cli
command to build the app and serve it locally.
git clone <repository-url>
this repositorycd javascript-madlibraries
npm install
ember serve
- Visit your app at http://localhost:4200.
Deploy to GitHub pages with ember-cli-deploy-git