Crate relevancy

Source
Expand description

Proposed API for the relevancy component (validation phase)

The goal here is to allow us to validate that we can reliably detect user interests from history data, without spending too much time building the API out. There’s some hand-waving towards how we would use this data to rank search results, but we don’t need to come to a final decision on that yet.

Modules§

url_hash

Macros§

debug
error
info
trace
warn

Structs§

BanditCache
InterestMetrics
Interest metrics that we want to send to Glean as part of the validation process. These contain the cosine similarity when comparing the user’s interest against various interest vectors that consumers may use.
InterestVector
Vector storing a count value for each interest
RelevancyDb
A thread-safe wrapper around an SQLite connection to the Relevancy database
RelevancyStore

Enums§

Error
Errors we use internally
Interest
List of possible interests for a domain. Domains can have be associated with one or multiple interests. Inconclusive is used for domains in the user’s top sites that we can’t classify because there’s no corresponding entry in the interest database.
RelevancyApiError
Errors we return via the public interface.

Functions§

score
Calculate score for a piece of categorized content based on a user interest vector.

Type Aliases§

ApiResult
Result enum for the public API
Result
Result enum for internal functions