Skip to content
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

[BUG] compatibility issue with spacy v3 #48

Closed
virdiprateek opened this issue Feb 10, 2021 · 3 comments · Fixed by #49 or #52
Closed

[BUG] compatibility issue with spacy v3 #48

virdiprateek opened this issue Feb 10, 2021 · 3 comments · Fixed by #49 or #52
Labels
bug Something isn't working

Comments

@virdiprateek
Copy link

virdiprateek commented Feb 10, 2021

I'm testing the way it's mentioned in the examples as follows:

import spacy
from contextualSpellCheck import ContextualSpellCheck

nlp = spacy.load("en_core_web_sm")
checker = ContextualSpellCheck(max_edit_dist=100)
nlp.add_pipe(checker)

doc = nlp("Income was $9.4 milion compared to the prior year of $2.7 milion.")
print(doc._.outcome_spellCheck)

Getting error:

`nlp.add_pipe` now takes the string name of the registered component factory, not a callable component. Expected string, but got <contextualSpellCheck.contextualSpellCheck.ContextualSpellCheck object at 0x7f923add6c10> (name: 'None')

Can you please suggest the fix for this??

@virdiprateek virdiprateek added the bug Something isn't working label Feb 10, 2021
jonmun added a commit to jonmun/contextualSpellCheck that referenced this issue Feb 10, 2021
@jonmun
Copy link
Contributor

jonmun commented Feb 10, 2021

This is due to changes introduced in spacy v3: https://nightly.spacy.io/usage/v3#migrating-add-pipe

I've submitted a pull request to fix this issues.

@R1j1t
Copy link
Owner

R1j1t commented Feb 10, 2021

@virdiprateek as mentioned by @jonmun there might be some issues when using the package with spacy v3. As a temporary solution you can downgrade the spacy to v2.x (if possible for your use case). In the mean time I will check and merge #49 to fix the issue.

Thanks you @jonmun for the PR!!

R1j1t added a commit that referenced this issue Feb 10, 2021
- Reported by #48
- This will act as a temporary fix. Permanent fix in #49
@R1j1t R1j1t closed this as completed in 63003ac Feb 10, 2021
@R1j1t R1j1t changed the title [BUG] [BUG] compatibility issue with spacy v3 Feb 10, 2021
@R1j1t
Copy link
Owner

R1j1t commented Feb 10, 2021

@virdiprateek I have updated contextualSpellCheck 0.3.4

Please try to install the latest package and you will not face this issue. In the mean time I will work on spacy v3 compatibility which I hope to release in a couple of days.

@R1j1t R1j1t reopened this Feb 10, 2021
@R1j1t R1j1t linked a pull request Feb 11, 2021 that will close this issue
2 tasks
@R1j1t R1j1t added this to In progress in Code Dashboard Feb 11, 2021
R1j1t added a commit that referenced this issue Feb 12, 2021
* Resolved #48 by migrating the code to match the nlp pipeline in spacy v3. See: https://nightly.spacy.io/usage/v3#migrating-add-pipe

* updated tests in contextualSpellCheck.py to match the pipeline in spacy v3

* updated spacy dependency number

* black lint

* Update tests

Co-authored-by: R1j1t <22280243+R1j1t@users.noreply.github.com>
@R1j1t R1j1t mentioned this issue Feb 12, 2021
5 tasks
@R1j1t R1j1t linked a pull request Feb 16, 2021 that will close this issue
5 tasks
@R1j1t R1j1t closed this as completed in #52 Feb 16, 2021
R1j1t added a commit that referenced this issue Feb 16, 2021
* Update to spacyv3 (#49)

* Resolved #48 by migrating the code to match the nlp pipeline in spacy v3. See: https://nightly.spacy.io/usage/v3#migrating-add-pipe

* updated tests in contextualSpellCheck.py to match the pipeline in spacy v3

* updated spacy dependency number

* black lint

* Update tests

Co-authored-by: R1j1t <22280243+R1j1t@users.noreply.github.com>

* updated the type check based on PEP 3017

Ref:
- https://stackoverflow.com/a/21384492/7630458
- https://docs.python.org/3/library/typing.html
- https://www.python.org/dev/peps/pep-3107/

* updated README and controller

* reflected changes in examples and other housekeeping

* preparing for release

* removed optional config from README usage

Co-authored-by: jonmun <jonny.munro@hotmail.co.uk>
@R1j1t R1j1t moved this from In progress to Done in Code Dashboard Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
3 participants