INNER CODE UNIT · Python
check_probabilities
HendrikStrobelt/detecting-fake-text · backend/api.py:27
def check_probabilities(self, in_text, topk=40):
"""
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