Published
Edited
Jun 30, 2021
2 forks
11 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
doc = nlp.readDoc( text );
Insert cell
Insert cell
{
// Markup each entity.
doc.entities()
.each((e) => e.markup('<b>', `</b><sub>[${e.out(its.detail).type}]</sub>`));
// Return as HTML.
return html`<p class='entity'>${doc.out(its.markedUpText)}</p>`;
}
Insert cell
Insert cell
{
let table = '<table><tr><th>Word</th><th>Frequency</th></tr>';
doc.tokens()
.out(its.type, as.freqTable)
.forEach((e) => {table+=`<tr><td>${e[0]}</td><td>${e[1]}</td></tr>`;})
return html`${table}</table>`;
}
Insert cell
Insert cell
Insert cell
Insert cell
winkNLP = (await import('https://cdn.skypack.dev/wink-nlp')).default;
Insert cell
Insert cell
model = (await import('https://cdn.skypack.dev/wink-eng-lite-web-model')).default;
Insert cell
Insert cell
nlp = winkNLP( model );
Insert cell
Insert cell
its = nlp.its;
Insert cell
as = nlp.as;
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