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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more