Skip to content

Fix spacy component example (issue #96)#97

Open
iibrahimli wants to merge 1 commit into
nipunsadvilkar:masterfrom
iibrahimli:patch-1
Open

Fix spacy component example (issue #96)#97
iibrahimli wants to merge 1 commit into
nipunsadvilkar:masterfrom
iibrahimli:patch-1

Conversation

@iibrahimli

@iibrahimli iibrahimli commented Apr 25, 2021

Copy link
Copy Markdown

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
Copy Markdown

Why is this not merged yet?

@LifeIsStrange

Copy link
Copy Markdown

@nipunsadvilkar

1 similar comment
@bojanstef

Copy link
Copy Markdown

@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