File size: 1,093 Bytes
b992421 a6aa5e6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
---
license: apache-2.0
---
# neuspell-scrnn-probwordnoise
> towards a reliable workaround for the `neuspell` lib being broken
- here, the `SclstmChecker()` would be used
## original usage
this one would use bert checker
```python
!pip install -U neuspell -q
data_folder = "/usr/local/lib/python3.7/dist-packages/neuspell"
import neuspell
from neuspell import *
""" select spell checkers & load """
# checker = SclstmChecker(pretrained=True)
# checker.from_pretrained()
# ^^are the standard method and broken
url = "https://www.dropbox.com/sh/7u160z9gvijnc06/AACf3RDpbFn76vKS-f5rzvxWa?dl=1" #@param {type:"string"}
!wget $url -O mychecker.zip
import os
target_dir = "/content/dl-checker"
os.makedirs(target_dir, exist_ok=True)
!unzip /content/mychecker.zip -d $target_dir
# checker3 = BertChecker()
checker4 = SclstmChecker()
checker4.from_pretrained(target_dir)
checker4.correct("I luk foward to receving your reply")
checker4.correct_strings(
["I luk foward to receving your reply",
"hooba dooba im like a pooba",
"were did wendigo goe goating?"]
)
``` |