-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't view sample code. #290
Comments
Same problem here as well! I also wasn't able to run the example code on the README file. I figured the interface changed. Or I may be wrong? >>> import sentencepiece as spm
>>> s = spm.SentencePieceProcessor()
>>> s.Load('spm.model')
>>> for n in range(5):
... s.SampleEncodeAsPiece('New York', -1, 0.1)
...
['▁', 'N', 'e', 'w', '▁York']
['▁', 'New', '▁York']
['▁', 'New', '▁Y', 'o', 'r', 'k']
['▁', 'New', '▁York']
['▁', 'New', '▁York'] |
You can use
Here, there is a typo: |
Should fix google#290, google#221 according to code source https://github.com/google/sentencepiece/blob/master/python/sentencepiece.py#L153.
I am trying to run sentencepiece example give in readme but stuck with this following error
|
I'm following this page.
The colab notebook can't be accessed. Here is the link of the page. I am trying to access
sample code
link. https://github.com/google/sentencepiece/blob/master/tensorflow/README.mdThe text was updated successfully, but these errors were encountered: