Published
Edited
Nov 22, 2019
5 forks
140 stars
Insert cell
Insert cell
Insert cell
tfidf = import("tiny-tfidf")
Insert cell
Insert cell
Insert cell
Insert cell
metadata = d3.csv(
"https://raw.githubusercontent.com/fivethirtyeight/data/master/state-of-the-state/index.csv"
)
Insert cell
Insert cell
states = metadata.map(d => d.state);
Insert cell
Insert cell
Insert cell
speeches = Promise.all(files.map(d => d3.text(d)))
Insert cell
Insert cell
corpus = new tfidf.Corpus(
states,
speeches,
useStopwords,
customStopwords,
K1,
b
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
similarity = new tfidf.Similarity(corpus)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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