Skip to content

Commit 276b598

Browse files
authored
Merge pull request #75 from aCLImatise/spacy-3
Spacy 3
2 parents cd682da + 5b5abba commit 276b598

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

aclimatise/nlp.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
import wordsegment
33

44

5+
@spacy.language.Language.component("prevent_sentence_boundary")
56
def prevent_sentence_boundary_detection(doc):
67
for token in doc:
78
token.is_sent_start = False
89
return doc
910

1011

1112
try:
12-
nlp = spacy.load("en")
13-
no_sentences = spacy.load("en")
13+
nlp = spacy.load("en_core_web_sm")
14+
no_sentences = spacy.load("en_core_web_sm")
1415
no_sentences.add_pipe(
15-
prevent_sentence_boundary_detection, name="prevent-sbd", before="parser"
16+
"prevent_sentence_boundary", name="prevent-sbd", before="parser"
1617
)
1718
except IOError:
1819
raise Exception(

docs/changes.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
Changelog
22
=========
3+
3.0.1 (2021-02-10)
4+
------------------
5+
* Pin spacy dependency above 3.x.x
6+
* Remove support for older spacy versions
37

48
3.0.0 (2021-01-27)
5-
----------------
9+
------------------
610
Breaking Changes
711
****************
812
* Rework of executors

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
install_requires=[
77
"pyparsing",
88
"jinja2",
9-
"spacy",
9+
"spacy~=3.0",
1010
"miniwdl",
1111
"wordsegment",
1212
"inflection",
@@ -21,7 +21,7 @@
2121
"psutil",
2222
"deprecated",
2323
"attrs",
24-
"janis-pipelines.core >= 0.11.2",
24+
"janis-pipelines.core>=0.11.2",
2525
],
2626
python_requires=">=3.6",
2727
entry_points={"console_scripts": ["aclimatise = aclimatise.cli:main"]},

0 commit comments

Comments
 (0)