Skip to main content

Likelihood

This endpoint returns the log-likelihood of every token in the input sequence as well as their sum.
To learn more about the concept of likelihood, see here, and to see how likelihood can be used for model evaluation, see here.

Usage#

    Sample Response#

    {
    "likelihood":-46.74832,
    "token_likelihoods":[
    {"token":"so"},
    {"token":" I","likelihood":-2.7963603},
    {"token":" cre","likelihood":-11.007304},
    {"token":"pt","likelihood":-0.18487053},
    {"token":" up","likelihood":-1.7509942},
    {"token":" the","likelihood":-2.2046893},
    {"token":" basement","likelihood":-6.5210433},
    {"token":" stairs","likelihood":-0.13984226},
    {"token":" and","likelihood":-1.1252899},
    {"token":" BO","likelihood":-10.85497},
    {"token":"OO","likelihood":-4.700402},
    {"token":"O", "likelihood":-1.6468925},
    {"token":"!", "likelihood":-3.8156648}
    ]
    }

    Request#

    text#

    string
    The string to compute the log-likelihood of.

    Response#

    likelihood#

    float
    The sum of the log-likelihoods of each token in the string.

    token_likelihoods#

    array of objects

    An array of objects with the following shape:

    {
    "token": string,
    "likelihood": float
    }

    The likelihood refers to the log-likelihood of the token. The first token will not have a likelihood.