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

Update to spacyv3 #49

Merged
merged 6 commits into from
Feb 12, 2021
Merged

Conversation

jonmun
Copy link
Contributor

@jonmun jonmun commented Feb 10, 2021

… v3. See: https://nightly.spacy.io/usage/v3#migrating-add-pipe

Description

  • Issue this PR address?
  • Any other information you think is relevant

Updated ContextualSpellChecker to work with spacy-v3. This is needed as spacy has changed how to add components to the pipeline: https://nightly.spacy.io/usage/v3#migrating-add-pipe

To run this code with spacy v3, a string "contextual_spellchecker" is passsed to add_pipe instead of the ContextualSpellChecker object.

Checklist

  • Added and/or updated the test (not required for documentation changes)
  • My changes don't require a change to the documentation, or if they do, I've added all required information

@R1j1t R1j1t changed the base branch from dev to master February 10, 2021 14:38
@R1j1t
Copy link
Owner

R1j1t commented Feb 10, 2021

I have changed the base branch to master and there are a few things which needs to be added:

  1. Test case update
  2. Setting spacy version number >=3
  3. documentation update

If you can add them that would be great otherwise I will add them.

R1j1t added a commit that referenced this pull request Feb 10, 2021
- Reported by #48
- This will act as a temporary fix. Permanent fix in #49
R1j1t added a commit that referenced this pull request Feb 10, 2021
* restricted the package dependency of spacy to <3

- Reported by #48
- This will act as a temporary fix. Permanent fix in #49

* added py 3.9 to github action and updated requirements.txt

* some ci issue occuring when installing mecab-python3
@R1j1t R1j1t linked an issue Feb 11, 2021 that may be closed by this pull request
@R1j1t R1j1t changed the base branch from master to feature/spaCyv3Support February 12, 2021 17:00
@R1j1t R1j1t merged commit 8c574ef into R1j1t:feature/spaCyv3Support Feb 12, 2021
@R1j1t R1j1t added the enhancement New feature or request label Feb 12, 2021
R1j1t added a commit that referenced this pull request 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] compatibility issue with spacy v3
2 participants