Easily create Markov models from a given set of observations to generate random sequences of other potential observations. Larger data sets can be pre-computed using the new transition generator.
;// Our observations consist of four sentences from a rando's Twitter accountconst observations = 'a sentence' 'another sentence' 'one more' 'and the last';// Give Marc the observations and tell it our token delimiter (' ')const m = observations delimiter: ' ' order: 1 ;// Generate a probable observationconst random = m;
Run the example
$> npm run example
Pre Compute transitions (recommended for large data sets)
With global install
$> npm install -g @tmanderson/marc$> marc observations.json transitions.json
$> ./bin/index.js observations.json transitions.json
transitions.json file can be used with Marc via
when creating an instance.
A few examples, some funny, others serious (from NYTimes homepage, 01-19-2018):
- Cuomo Looks at The Bike That Could Cost $11.52
- Vows: For Love of Oat Milk Merkel?
- ICE Detained My Life
- How the Worst Way to Help Travelers Choose Safe Destinations
- Brand to Pretend They’re Homeless Pro-Life Movement Has Plenty
- Why James Franco Could Cost $11.52
- Timeline: How Congress Breaks Down the Collusion We Were Waiting For?
- Military Shifts Focus to Trump’s Radical Honesty
- Trump Administration on #MeToo Moment Shape the Bitcoin Bubble
- Sundance Film Festival: 5 Movies to Thwart Federal Government