FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge pull request #550 from Kaggle/allennlp-no-deps-ci · vfdev-5/docker-python@577b970 · GitHub

Commit 577b970

Browse files
authored
Merge pull request Kaggle#550 from Kaggle/allennlp-no-deps-ci
Do not install allennlp dependencies until conflict is resolved
2 parents 9d9fa88 + c574bc0 commit 577b970

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎Dockerfile‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,16 @@ RUN pip install bcolz && \
437437
pip install torchtext && \
438438
/tmp/clean-layer.sh
439439

440+
# allennlp and dependencies
441+
# TODO: install deps when underlying dependency is fixed. https://github.com/Kaggle/docker-python/issues/548
442+
RUN pip install jsonnet overrides tensorboardX && \
443+
pip install flask>=1.0.2 flask-cors>=3.0.7 gevent>=1.3.6 && \
444+
pip install unidecode parsimonious>=0.8.0 sqlparse>=0.2.4 word2number>=1.1 && \
445+
pip install pytorch-pretrained-bert>=0.6.0 jsonpickle && \
446+
pip install requests>=2.18 editdistance conllu==0.11 && \
447+
pip install --no-dependencies allennlp && \
448+
/tmp/clean-layer.sh
449+
440450
###########
441451
#
442452
# NEW CONTRIBUTORS:

‎tests/test_allennlp.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import unittest
2+
3+
from allennlp.data.tokenizers import WordTokenizer
4+
5+
6+
class TestAllenNlp(unittest.TestCase):
7+
# reference
8+
# https://github.com/allenai/allennlp/blob/master/allennlp/tests/data/tokenizers/word_tokenizer_test.py
9+
def test_passes_through_correctly(self):
10+
tokenizer = WordTokenizer(start_tokens=['@@', '%%'], end_tokens=['^^'])
11+
sentence = "this (sentence) has 'crazy' \"punctuation\"."
12+
tokens = [t.text for t in tokenizer.tokenize(sentence)]
13+
expected_tokens = ["@@", "%%", "this", "(", "sentence", ")", "has", "'", "crazy", "'", "\"",
14+
"punctuation", "\"", ".", "^^"]
15+
assert tokens == expected_tokens

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL