Public
Edited
Feb 7, 2024
Insert cell
Insert cell
result = {
nlp.extend(plugin)
let doc = nlp('i saw John Lennon, and tom cruise.')

doc.people().forEach(m => {
if (m.has('john lennon')) {
m.addPayload({ height: `5'11` })
}
if (m.has('tom cruise')) {
m.addPayload({ height: `5'8` })
}
})
return doc.getPayloads().map(o=>{
return {match:o.match.text(), val:o.val} //pretty-print it
})
}
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