Is there a way to visually represent parts of speech data in CSS for text that has been tagged with such classifications? Take the sentence Ten pins were set in order.
, which, when parsed using Spacy, results in:
token pos
1 Ten NUM
2 pins NOUN
3 were AUX
4 set VERB
5 in ADP
6 order NOUN
7 . PUNCT
I can display this information in HTML like so:
<p>
<span style="color:green" title="NUM">Ten</span>
<span style="color:red" title="NOUN">pins</span>
<span style="color:purple" title="AUX">were</span>
<span style="color:skyblue" title="VERB">set</span>
<span style="color:orange" title="ADP">in</span>
<span style="color:red" title="NOUN">order</span>
<span style="color:navy" title="PUNCT">.</span>
</p>
This is how it appears (with the use of the title attribute shown by hovering over "pins"):
https://i.sstatic.net/lNVTd.png
To explore the metadata, interactivity is needed. Is there a CSS method to permanently display all the tags' title or other attributes? Ideally, these details would be offset above or below the word.