- JS library
- fetches JSON-formatted named entity annotations and transforms them into semantic HTML
- wraps the entities in the HTML5 element for highlighted text
- entity is assigned the data attribute
data-entity
- the labels are displayed and styled using only CSS selectors
<div class="entities">
When <mark data-entity="person">Sebastian Thrun</mark> started working on
self-driving cars at <mark data-entity="org">Google</mark> in
<mark data-entity="date">2007</mark>, few people outside of the company took
him seriously.
</div>
How displaCy ENT works
- a simple JavaScript function
- It takes the list of spans returned by the server, slices the original text into fragments and, if an entity should be visualised, wraps it in a tag and adds the right data attribute.
Zdroje