pszemraj commited on
Commit
69955b6
1 Parent(s): 27caaa6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -32
README.md CHANGED
@@ -1,48 +1,39 @@
1
  ---
2
  license: apache-2.0
3
  ---
4
- # pszemraj/neuspell-subwordbert-probwordnoise
5
 
6
- > towards a reliable workaround for the ``neuspell` lib being broken
7
 
8
- ## original usage
9
 
 
10
 
11
- this one would use bert checker
12
-
13
- ```python
14
- !pip install -U neuspell -q
15
-
16
- data_folder = "/usr/local/lib/python3.7/dist-packages/neuspell"
17
 
 
 
 
 
18
 
19
- import neuspell
20
- from neuspell import *
21
 
22
 
23
- """ select spell checkers & load """
24
- # checker = SclstmChecker(pretrained=True)
25
- # checker.from_pretrained()
26
- # ^^are the standard method and broken
27
 
28
- url = "https://www.dropbox.com/sh/7u160z9gvijnc06/AACf3RDpbFn76vKS-f5rzvxWa?dl=1" #@param {type:"string"}
29
 
30
- !wget $url -O mychecker.zip
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
- # checker3 = BertChecker()
38
- checker4 = SclstmChecker()
39
- checker4.from_pretrained(target_dir)
40
 
41
- checker4.correct("I luk foward to receving your reply")
42
 
43
- checker4.correct_strings(
44
- ["I luk foward to receving your reply",
45
- "hooba dooba im like a pooba",
46
- "were did wendigo goe goating?"]
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
+ ```