Skip to content

Commit 94eada8

Browse files
authored
Add tensorflow_text package (#1214)
http://b/267320648
1 parent 3ff0017 commit 94eada8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Dockerfile.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ RUN pip install pysal \
197197
pip install -f https://h2o-release.s3.amazonaws.com/h2o/latest_stable_Py.html h2o \
198198
"tensorflow-gcs-config<=${TENSORFLOW_VERSION}" \
199199
tensorflow-addons==0.17.1 \
200-
tensorflow_decision_forests==0.2.7 && \
200+
tensorflow_decision_forests==0.2.7 \
201+
tensorflow_text==2.9.0 && \
201202
/tmp/clean-layer.sh
202203

203204
RUN apt-get install -y libfreetype6-dev && \

tests/test_tensorflow_text.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import unittest
2+
3+
import tensorflow_text as tf_text
4+
5+
6+
class TestTensorflowText(unittest.TestCase):
7+
def test_tokenizer(self):
8+
word_tokenizer = tf_text.WhitespaceTokenizer()
9+
10+
tokens = word_tokenizer.tokenize("I love Kaggle!")
11+
12+
self.assertEqual((3,), tokens.shape)

0 commit comments

Comments
 (0)