Skip to content

ShiftColorConfig

ShiftColorConfig dataclass

Configuration for the bar colors of a word shift plot.

The bars indicate the kind of contribution each token makes. The prefixes more_of_* and less_of_* indicate whether a token was used more or less in the comparison corpus versus the reference corpus. The suffixes *_positive and *_negative indicate whether a token is relatively positive or negative compared to the specified reference score. The bars higher_score and lower_score indicate whether the token's score is higher or lower in the comparison corpus. Each of these six bars also has a *_counteracted variant, for when the two base bars are opposite signs and partially cancel out. A counteracted bar is drawn in its base bar's color, faded by counteracted_opacity, so it is not colored separately.

Attributes:

Name Type Description
more_of_negative str

Color of bars where the token is used more in the comparison and has a relatively negative score

more_of_positive str

Color of bars where the token is used more in the comparison and has a relatively positive score

less_of_positive str

Color of bars where the token is used less in the comparison and has a relatively positive score

less_of_negative str

Color of bars where the token is used less in the comparison and has a relatively negative score

lower_score str

Color of bars where the token's score is lower in the comparison than the reference

higher_score str

Color of bars where the token's score is higher in the comparison than the reference

counteracted_opacity float

Opacity of the *_counteracted bars, as a fraction between 0 and 1. Each one is drawn in its base bar's color at this opacity

grand_total str

Color of the grand total bar in the totals panels

Source