guesslang / pipeline.py
nateraw's picture
Create pipeline.py
f8acad1
raw
history blame
220 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]]