Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
nateraw
/
guesslang
like
0
Text Classification
generic
Model card
Files
Files and versions
Community
4a4ed31
guesslang
/
pipeline.py
nateraw
Update pipeline.py
231ea7d
almost 3 years ago
raw
Copy download link
history
blame
Safe
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
]]