nateraw commited on
Commit
f8acad1
·
1 Parent(s): 7516823

Create pipeline.py

Browse files
Files changed (1) hide show
  1. pipeline.py +8 -0
pipeline.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from guesslang import Guess
2
+
3
+ class PreTrainedPipeline():
4
+ def __init__(self, path=""):
5
+ self.guess = Guess()
6
+
7
+ def __call__(self, text):
8
+ return [{k: v} for k, v in self.guess.probabilities(text)[:5]]