|
10 | 10 |
|
11 | 11 | from orangecontrib.text import Corpus
|
12 | 12 | from orangecontrib.text.keywords import tfidf_keywords, yake_keywords, \
|
13 |
| - rake_keywords, embedding_keywords |
| 13 | + rake_keywords |
14 | 14 | from orangecontrib.text.preprocess import *
|
15 | 15 | from orangecontrib.text.widgets.owkeywords import OWKeywords, run, \
|
16 | 16 | AggregationMethods, ScoringMethods
|
@@ -182,10 +182,14 @@ def test_sort_nans_asc(self):
|
182 | 182 | ["System", "Widths", "opinion"])
|
183 | 183 |
|
184 | 184 | def test_scoring_methods(self):
|
| 185 | + # speed-up the test execution |
| 186 | + def dummy_embedding(tokens, language, progress_callback=None): |
| 187 | + return tfidf_keywords(tokens, progress_callback) |
| 188 | + |
185 | 189 | methods = [("TF-IDF", Mock(wraps=tfidf_keywords)),
|
186 | 190 | ("YAKE!", Mock(wraps=yake_keywords)),
|
187 | 191 | ("Rake", Mock(wraps=rake_keywords)),
|
188 |
| - ("Embedding", Mock(wraps=embedding_keywords))] |
| 192 | + ("Embedding", Mock(side_effect=dummy_embedding))] |
189 | 193 | with patch.object(ScoringMethods, "ITEMS", methods) as m:
|
190 | 194 | scores = {"TF-IDF", "YAKE!", "Rake", "Embedding"}
|
191 | 195 | settings = {"selected_scoring_methods": scores}
|
|
0 commit comments