Published
Edited
Mar 5, 2020
6 forks
Importers
33 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
words = toWords(doc.nouns().out('topk')) // sort by frequency
.concat(toWords(doc.verbs().out('topk')))
.concat(toWords(doc.adverbs().out('topk')))
.concat(toWords(doc.adjectives().out('topk')))
.sort((a,b) => b.freq - a.freq)
Insert cell
doc = nlp(text.value).normalize({
whitespace: true, // remove hyphens, newlines, and force one space between words
punctuation: true, // remove commas, semicolons - but keep sentence-ending punctuation
case: true, // keep only first-word, and 'entity' titlecasing
numbers: true, // 'one' → '1'
plurals: true, // 'eyes' → 'eye'
verbs: true, // 'swtiched' → 'switch'
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
nlp = require('compromise@11.14.3')
Insert cell
Insert cell
d3cloud = require('d3-cloud')
Insert cell
import {rasterize, serialize} from '@mbostock/saving-svg'
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more