| import { tr } from '../../shared/lang/i18n-lite'; |
| import type { HistogramExtent, HistogramExtentBound } from '../../shared/vis/Histogram'; |
|
|
| export type { HistogramExtent, HistogramExtentBound }; |
|
|
| |
| |
| |
| export interface HistogramBaseConfig { |
| label: string; |
| no_bins: number; |
| extent: HistogramExtent; |
| averageLabel?: string; |
| showLeftInfinity?: boolean; |
| showRightInfinity?: boolean; |
| xAxisTickSkip?: number; |
| |
| xAxisTickRound?: boolean; |
| yScaleType?: 'linear' | 'sqrt' | 'log'; |
| } |
|
|
| |
| |
| |
| export interface ScatterPlotBaseConfig { |
| xLabel: string; |
| yLabel: string; |
| label?: string; |
| } |
|
|
| |
| |
| |
| export const getTokenSurprisalHistogramConfig = (): HistogramBaseConfig => ({ |
| label: tr("information per token histogram"), |
| no_bins: 19, |
| extent: [0, 19], |
| averageLabel: tr("bits/token"), |
| showRightInfinity: true, |
| }); |
|
|
| |
| |
| |
| export const getByteSurprisalHistogramConfig = (): HistogramBaseConfig => ({ |
| label: tr("information per byte histogram"), |
| no_bins: 13, |
| extent: [0, 6.5], |
| averageLabel: tr("bits/Byte"), |
| showRightInfinity: true, |
| }); |
|
|
| |
| |
| |
| export const getDeltaByteSurprisalHistogramConfig = (): HistogramBaseConfig => ({ |
| label: tr("Δinformation per byte histogram"), |
| no_bins: 20, |
| xAxisTickSkip: 1, |
| xAxisTickRound: true, |
| extent: [-5, 5], |
| averageLabel: tr("Δ bits/Byte"), |
| showLeftInfinity: true, |
| showRightInfinity: true, |
| }); |
|
|
| |
| |
| |
| export const getSurprisalProgressConfig = (): ScatterPlotBaseConfig => ({ |
| label: tr("information per token progress"), |
| xLabel: tr("token index"), |
| yLabel: tr("information (bits)"), |
| }); |
|
|
| |
| |
| |
| |
| export const getMatchScoreProgressConfig = (): ScatterPlotBaseConfig => ({ |
| label: tr("semantic match per chunk progress"), |
| xLabel: tr("character offset"), |
| yLabel: tr("chunk match degree"), |
| }); |
|
|
| |
| |
| |
| export const getRawScoreNormedHistogramConfig = (): HistogramBaseConfig => ({ |
| label: tr("semantic score histogram"), |
| no_bins: 20, |
| xAxisTickSkip: 1, |
| xAxisTickRound: true, |
| extent: [0, 1], |
| yScaleType: 'sqrt', |
| }); |
|
|
|
|