Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/reranker-transformersjs / extractPairScores
Function: extractPairScores()
ts
function extractPairScores(raw, pairCount): number[];Defined in: packages/reranker-transformersjs/src/cross-encoder.ts:104
Internal
Normalises the raw pipeline output to a flat score[] aligned with the input pair order. Cross-encoder classifiers return either a single-best {label, score} per pair or an array of topk entries — we collapse on the highest-scoring positive label.
Parameters
| Parameter | Type |
|---|---|
raw | | readonly ClassifierResult[] | readonly readonly ClassifierResult[][] |
pairCount | number |
Returns
number[]