File size: 221 Bytes
f8acad1
 
 
 
 
 
 
231ea7d
1
2
3
4
5
6
7
8
9
from guesslang import Guess

class PreTrainedPipeline():
    def __init__(self, path=""):
        self.guess = Guess()

    def __call__(self, text):
        return [{k: v} for k, v in self.guess.probabilities(text)[:5]]