Skip to content

Commit

Permalink
Update spacy to version 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Apr 29, 2020
1 parent 8cd8f5f commit 0f0a0dc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ twine
twython
sphinx>=3.0,<3.1
sphinx_rtd_theme
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.1.0/en_core_web_sm-2.1.0.tar.gz#egg=en_core_web_sm
https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-2.1.0/de_core_news_sm-2.1.0.tar.gz#egg=de_core_news_sm
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.5/en_core_web_sm-2.2.5.tar.gz#egg=en_core_web_sm
https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-2.2.5/de_core_news_sm-2.2.5.tar.gz#egg=de_core_news_sm
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ nltk>=3.2,<4.0
pint>=0.8.1
python-dateutil>=2.8,<2.9
pyyaml>=5.3,<5.4
spacy>=2.1,<2.2
spacy>=2.2,<2.3
sqlalchemy>=1.3,<1.4
pytz
2 changes: 1 addition & 1 deletion tests/test_comparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_exact_match_different_stopwords(self):

value = self.compare(statement, other_statement)

self.assertAlmostEqual(value, 0.9, places=1)
self.assertAlmostEqual(value, 0.7, places=1)

def test_exact_match_different_capitalization(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_tagging_german(self):
def test_string_becomes_lowercase(self):
tagged_text = self.tagger.get_text_index_string('THIS IS HOW IT BEGINS!')

self.assertEqual(tagged_text, 'DET:be VERB:how ADV:it NOUN:begin')
self.assertEqual(tagged_text, 'DET:be VERB:how ADV:it PRON:begin')

def test_tagging_medium_sized_words(self):
tagged_text = self.tagger.get_text_index_string('Hello, my name is Gunther.')
Expand All @@ -57,7 +57,7 @@ def test_tagging_medium_sized_words(self):
def test_tagging_long_words(self):
tagged_text = self.tagger.get_text_index_string('I play several orchestra instruments for pleasure.')

self.assertEqual(tagged_text, 'VERB:orchestra ADJ:instrument NOUN:pleasure')
self.assertEqual(tagged_text, 'VERB:orchestra NOUN:instrument NOUN:pleasure')

def test_get_text_index_string_punctuation_only(self):
bigram_string = self.tagger.get_text_index_string(
Expand Down
4 changes: 2 additions & 2 deletions tests/training/test_ubuntu_corpus_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_train_sets_search_text(self):
results = list(self.chatbot.storage.filter(text='Is anyone there?'))

self.assertEqual(len(results), 2)
self.assertEqual(results[0].search_text, 'VERB:anyone NOUN:there')
self.assertEqual(results[0].search_text, 'AUX:anyone PRON:there')

def test_train_sets_search_in_response_to(self):
"""
Expand All @@ -190,7 +190,7 @@ def test_train_sets_search_in_response_to(self):
results = list(self.chatbot.storage.filter(in_response_to='Is anyone there?'))

self.assertEqual(len(results), 2)
self.assertEqual(results[0].search_in_response_to, 'VERB:anyone NOUN:there')
self.assertEqual(results[0].search_in_response_to, 'AUX:anyone PRON:there')

def test_is_extracted(self):
"""
Expand Down
10 changes: 5 additions & 5 deletions tests_django/test_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,18 +292,18 @@ def test_search_text_contains_results_after_training(self):
string when filtering using the search_text parameter.
"""
self.chatbot.storage.create_many([
Statement('Example A for search.'),
Statement('Example 1 for search.'),
Statement('Another example.'),
Statement('Example B for search.'),
Statement('Example 2 for search.'),
Statement(text='Another statement.'),
])

results = list(self.chatbot.storage.filter(
search_text_contains=self.chatbot.storage.tagger.get_text_index_string(
'Example A for search.'
'Example 1 for search.'
)
))

self.assertEqual(len(results), 2, msg=[r.text for r in results])
self.assertEqual('Example A for search.', results[0].text)
self.assertEqual('Example B for search.', results[1].text)
self.assertEqual('Example 1 for search.', results[0].text)
self.assertEqual('Example 2 for search.', results[1].text)

0 comments on commit 0f0a0dc

Please sign in to comment.