Create pipeline.py
Browse files- 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]]
|