Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
Word count
node v8.17.0
version:
master
endpoint
share
tweet
var qm = require('qminer');
var base = new qm.Base({ mode: 'createClean', schema: [{ name: 'tweets', fields: [{ name: 'text', type: 'string' }] }] }); let tweetStore = base.store('tweets');
tweetStore.push({text: "This pen is green."}); tweetStore.push({text: "This pen is yellow."}); tweetStore.push({text: "This pen is blue."}); tweetStore.push({text: "This marker is yellow."}); var tweets = tweetStore.allRecords; 'got ' + tweets.length + ' tweets';
let distribution = tweets.aggr({ name: "test", type: "keywords", field: "text" })
distribution.keywords.forEach((el) => { console.log(el.keyword, el.weight); });
Loading…
no comments
sign in
to comment