Published
Edited
Mar 5, 2020
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
tagTypes
Insert cell
tagColors
Insert cell
normalizedDoc = 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
tags = normalizedDoc.out('tags')
Insert cell
Insert cell
Insert cell
Insert cell
nlp = require('compromise@11.14.3')
Insert cell
import {printList, printHtml} from '@spencermountain/nlp-compromise'
Insert cell
import {toWords, toShortList} from '@randomfractals/hello-nlp'
Insert cell
import {tagLegends, tagTypes, tagColors} from '@randomfractals/nlp-text-tags'
Insert cell
import {rasterize, serialize} from '@mbostock/saving-svg'
Insert cell
Insert cell
Insert cell
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