Update README.md
Browse files
README.md
CHANGED
@@ -1,48 +1,39 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
-
#
|
5 |
|
6 |
-
> towards a reliable workaround for the
|
7 |
|
8 |
-
|
9 |
|
|
|
10 |
|
11 |
-
this
|
12 |
-
|
13 |
-
```python
|
14 |
-
!pip install -U neuspell -q
|
15 |
-
|
16 |
-
data_folder = "/usr/local/lib/python3.7/dist-packages/neuspell"
|
17 |
|
|
|
|
|
|
|
|
|
18 |
|
19 |
-
|
20 |
-
from neuspell import *
|
21 |
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
# ^^are the standard method and broken
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
import os
|
33 |
-
target_dir = "/content/dl-checker"
|
34 |
-
os.makedirs(target_dir, exist_ok=True)
|
35 |
-
!unzip /content/mychecker.zip -d $target_dir
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
checker4.from_pretrained(target_dir)
|
40 |
|
41 |
-
|
42 |
|
43 |
-
|
44 |
-
["I luk foward to receving your reply",
|
45 |
-
|
46 |
-
|
47 |
-
)
|
48 |
-
```
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
+
# neuspell-subwordbert-probwordnoise
|
5 |
|
6 |
+
> towards a reliable workaround for the `neuspell` lib being broken
|
7 |
|
8 |
+
See the [github repository](https://github.com/neuspell/neuspell) for usage and all official information.
|
9 |
|
10 |
+
## Usage
|
11 |
|
12 |
+
Clone this model repo with git:
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
+
```bash
|
15 |
+
sudo apt-get install git-lfs -q
|
16 |
+
git clone https://huggingface.co/pszemraj/neuspell-subwordbert-probwordnoise
|
17 |
+
```
|
18 |
|
19 |
+
Install `neuspell` from pypi:
|
|
|
20 |
|
21 |
|
22 |
+
```bash
|
23 |
+
pip install -U neuspell -q
|
24 |
+
```
|
|
|
25 |
|
26 |
+
Use in python for spell correction:
|
27 |
|
28 |
+
```python
|
29 |
+
from neuspell import BertChecker
|
|
|
|
|
|
|
|
|
30 |
|
31 |
+
checker = BertChecker()
|
32 |
+
checker.from_pretrained("./neuspell-scrnn-probwordnoise/")
|
|
|
33 |
|
34 |
+
checker.correct("I luk foward to receving your reply") # correct a string
|
35 |
|
36 |
+
checker.correct_strings(
|
37 |
+
["I luk foward to receving your reply", "were did wendigo goe boating?"]
|
38 |
+
) # correct a list of strings
|
39 |
+
```
|
|
|
|