INNER CODE UNIT · Python
that
HendrikStrobelt/detecting-fake-text · backend/api.py:29
Function that GLTR interacts with to check the probabilities of words
Params:
- in_text: str -- The text that you want to check
- topk: int -- Your desired truncation of the head of the distribution
Output:
- payload: dict -- The wrapper for results in this function, described below
Payload values
==============
bpe_strings: list of str -- Each individual token in the text
real_topk: list of tuples -- (ranking, prob) of each token
pred_topk: list of list of tuple -- (word, prob) for all topk
"""
raise NotImplementedError
def postprocess(self, token):