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