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

Fix spacy component example (issue #96) #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iibrahimli
Copy link

@iibrahimli iibrahimli commented Apr 25, 2021

Update the example to work with the latest spacy as installed by pip install spacy (version 3.0.6), and fix failure to segment sentences due to doc.char_span returning None. Fixes #96.

Add pipe to spacy model
Use the current spacy recommended way to add the pipe to a model.

Fix sentences not split due to extra chars
The doc.char_span uses alignment_mode="strict" by default, which returns None when sent_char_spans contains trailing spaces, for example. Change the alignment_mode to "contract" so that it returns correct spans.

Update the example to work with the latest spacy as installed by `pip install spacy` (version 3.0.6), and fix failure to segment sentences due to `doc.char_span` returning None. The `doc.char_span` uses `alignment_mode="strict"` by default, which returns `None` when `sent_char_spans` contains trailing spaces, for example. Change the `alignment_mode` to `"contract"` so that it returns correct spans.
@iibrahimli iibrahimli changed the title Fix spacy component example Fix spacy component example (issue #96) Apr 25, 2021
@sudarshan85
Copy link

Why is this not merged yet?

@LifeIsStrange
Copy link

@nipunsadvilkar

1 similar comment
@bojanstef
Copy link

@nipunsadvilkar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spacy integration example is broken
4 participants