Skip to content

Commit

Permalink
Fix bug where we fit vocab processor multiple times (conversationai#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericagreene authored Jan 29, 2018
1 parent 89aa8be commit abf13b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conversation_classification/kaggle/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def main():
MAX_DOCUMENT_LENGTH)

x_train = np.array(list(vocab_processor.fit_transform(x_train_text)))
x_test = np.array(list(vocab_processor.fit_transform(x_test_text)))
x_test = np.array(list(vocab_processor.transform(x_test_text)))
y_train = np.array(y_train)
y_test = np.array(y_test)

Expand Down Expand Up @@ -264,7 +264,7 @@ def main():
.format(len(data_unlabeled), FLAGS.predict_data))

x_unlabeled = np.array(list(
vocab_processor.fit_transform(data_unlabeled['comment_text'])))
vocab_processor.transform(data_unlabeled['comment_text'])))

unlabled_input_fn = tf.estimator.inputs.numpy_input_fn(
x={WORDS_FEATURE: x_unlabeled},
Expand Down

0 comments on commit abf13b3

Please sign in to comment.