guesslang / pipeline.py
nateraw's picture
Update pipeline.py
231ea7d
raw
history blame contribute delete
221 Bytes
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]]