edsnlp.utils.colors
create_colors(labels)
Assign a colour for each label, using category20 palette. The method loops over the colour palette in case there are too many labels.
PARAMETER | DESCRIPTION |
---|---|
labels |
List of labels to colorise in displacy.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Dict[str, str]
|
A displacy-compatible colour assignment. |
Source code in edsnlp/utils/colors.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|