Skip to contents

Formula: sum_q max_d q_i . d_j

Usage

Colbrt(query, docs)

Arguments

query

An nq x d matrix of query token embeddings.

docs

A list of documents, each an nd x d matrix.

Value

List with estimate, scores, ranking, best, max_sim, nq, n_docs, method.

Details

Every query token keeps its own vector and is scored against its best-matching document token; the sum of those maxima is the document score. Because the interaction happens after both sides are encoded, document vectors can be indexed offline – that is the "late" in late interaction. With unit-normalised vectors a document containing the query exactly scores n_q, the largest value possible.

References

Khattab & Zaharia (2020), ColBERT, SIGIR 2020:39-48.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Colbrt(V, V)
#> $estimate
#> [1] 8
#> 
#> $scores
#> [1] 8
#> 
#> $ranking
#> [1] 0
#> 
#> $best
#> [1] 0
#> 
#> $max_sim
#>      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,]    1    1    1    1    1    1    1    1
#> 
#> $nq
#> [1] 8
#> 
#> $n_docs
#> [1] 1
#> 
#> $method
#> [1] "ColBERT late-interaction retrieval scoring"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"