| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -373,8 +373,7 @@ RUN pip install bcolz && \ | |||
| 373 | 373 | pip install fastai && \ | |
| 374 | 374 | pip install torchtext && \ | |
| 375 | 375 | pip install allennlp && \ | |
| 376 | - # b/149359379 remove once allennlp 1.0 is released which won't cause a spacy downgrade. | ||
| 377 | - pip install spacy==2.2.3 && python -m spacy download en && python -m spacy download en_core_web_lg && \ | ||
| 376 | + python -m spacy download en && python -m spacy download en_core_web_lg && \ | ||
| 378 | 377 | apt-get install -y ffmpeg && \ | |
| 379 | 378 | /tmp/clean-layer.sh | |
| 380 | 379 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,15 +1,15 @@ | |||
| 1 | 1 | import unittest | |
| 2 | 2 | ||
| 3 | - from allennlp.data.tokenizers import WordTokenizer | ||
| 3 | + from allennlp.data.tokenizers import SpacyTokenizer | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | class TestAllenNlp(unittest.TestCase): | |
| 7 | 7 | # reference | |
| 8 | 8 | # https://github.com/allenai/allennlp/blob/master/allennlp/tests/data/tokenizers/word_tokenizer_test.py | |
| 9 | 9 | def test_passes_through_correctly(self): | |
| 10 | - tokenizer = WordTokenizer(start_tokens=['@@', '%%'], end_tokens=['^^']) | ||
| 10 | + tokenizer = SpacyTokenizer() | ||
| 11 | 11 | sentence = "this (sentence) has 'crazy' \"punctuation\"." | |
| 12 | 12 | tokens = [t.text for t in tokenizer.tokenize(sentence)] | |
| 13 | - expected_tokens = ["@@", "%%", "this", "(", "sentence", ")", "has", "'", "crazy", "'", "\"", | ||
| 14 | - "punctuation", "\"", ".", "^^"] | ||
| 15 | - assert tokens == expected_tokens | ||
| 13 | + expected_tokens = ["this", "(", "sentence", ")", "has", "'", "crazy", "'", "\"", | ||
| 14 | + "punctuation", "\"", "."] | ||
| 15 | + self.assertSequenceEqual(tokens, expected_tokens) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments