edsnlp.utils.colors
CATEGORY20 = ['#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78', '#2ca02c', '#98df8a', '#d62728', '#ff9896', '#9467bd', '#c5b0d5', '#8c564b', '#c49c94', '#e377c2', '#f7b6d2', '#7f7f7f', '#c7c7c7', '#bcbd22', '#dbdb8d', '#17becf', '#9edae5']
module-attribute
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 |
|