Hugging Face
Models
Datasets
Spaces
Buckets
new
Docs
Enterprise
Pricing
Website
Tasks
HuggingChat
Collections
Languages
Organizations
Community
Blog
Posts
Daily Papers
Learn
Discord
Forum
GitHub
Solutions
Team & Enterprise
Hugging Face PRO
Enterprise Support
Inference Providers
Inference Endpoints
Storage Buckets
Log In
Sign Up
nateraw
/
guesslang
like
0
Text Classification
generic
Model card
Files
Files and versions
xet
Community
Copy to bucket
new
main
guesslang
/
pipeline.py
nateraw
Update pipeline.py
231ea7d
over 4 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
]]