-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Sentence bounderies are now considered when check negations and …
…intensifiers
- Loading branch information
1 parent
ac2c2c6
commit 4caa5a1
Showing
4 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
__title__ = "asent" | ||
|
||
__version__ = "0.4.3" # the ONLY source of version ID | ||
__version__ = "0.5.4" # the ONLY source of version ID | ||
__download_url__ = "https://github.com/kennethenevoldsen/asent" | ||
__documentation__ = "https://kennethenevoldsen.github.io/asent" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Test specifically targeted an bugs.""" | ||
|
||
import spacy | ||
|
||
import asent # noqa | ||
|
||
|
||
def test_no_negations_and_intensifiers_out_of_sentence(): | ||
"""Test that no negations are not found outside the sentence span. | ||
https://github.com/KennethEnevoldsen/asent/issues/58 | ||
""" | ||
|
||
# create spacy pipeline | ||
nlp = spacy.blank("en") | ||
nlp.add_pipe("sentencizer") | ||
|
||
nlp.add_pipe("asent_en_v1") | ||
|
||
text = "Would you do that? I would not. Very stupid is what that is." | ||
doc = nlp(text) | ||
assert doc[10]._.is_negated is None | ||
|
||
text = "Would you do that? I would not very. Stupid is what that is." | ||
doc = nlp(text) | ||
assert doc[10]._.valence == doc[10]._.polarity.polarity |