incerto.llm.plot_token_uncertainty

incerto.llm.plot_token_uncertainty#

incerto.llm.plot_token_uncertainty(tokens, uncertainties, ax=None, title='Token-Level Uncertainty', cmap='YlOrRd')[source]#

Plot uncertainty as a heatmap over token sequence.

Parameters:
  • tokens (List[str]) – List of tokens

  • uncertainties (ndarray | Tensor) – Uncertainty values per token

  • ax – Matplotlib axes

  • title (str) – Plot title

  • cmap (str) – Colormap name