You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~\Anaconda3\lib\site-packages\keras_preprocessing\text.py in texts_to_sequences(self, texts)
276 A list of sequences.
277 """
--> 278 return list(self.texts_to_sequences_generator(texts))
279
280 def texts_to_sequences_generator(self, texts):
~\Anaconda3\lib\site-packages\keras_preprocessing\text.py in texts_to_sequences_generator(self, texts)
307 self.filters,
308 self.lower,
--> 309 self.split)
310 vect = []
311 for w in seq:
~\Anaconda3\lib\site-packages\keras_preprocessing\text.py in text_to_word_sequence(text, filters, lower, split)
56 translate_dict = dict((c, split) for c in filters)
57 translate_map = maketrans(translate_dict)
---> 58 text = text.translate(translate_map)
59
60 seq = text.split(split)
AttributeError: 'numpy.ndarray' object has no attribute 'translate'
I realize that this is a numpy issue. As a widely used libaray, numpy does not honor back compatibility. Can you please write some other code to take care of this problem?
In java, mvn tells you which version of jar should be used. It appears to me python is an open source wide west. Can you please tell me if there is a work around?
Thanks
The text was updated successfully, but these errors were encountered:
training = prepare_data(training)
validation = prepare_data(validation)
test = prepare_data(test)
print('Build model...')
print('Vocab size =', VOCAB)
AttributeError Traceback (most recent call last)
in
----> 1 training = prepare_data(training)
2 validation = prepare_data(validation)
3 test = prepare_data(test)
4
5 print('Build model...')
in (data)
1 to_seq = lambda X: pad_sequences(tokenizer.texts_to_sequences(X), maxlen=MAX_LEN)
----> 2 prepare_data = lambda data: (to_seq(data[0]), to_seq(data[1]), data[2])
in (X)
----> 1 to_seq = lambda X: pad_sequences(tokenizer.texts_to_sequences(X), maxlen=MAX_LEN)
2 prepare_data = lambda data: (to_seq(data[0]), to_seq(data[1]), data[2])
~\Anaconda3\lib\site-packages\keras_preprocessing\text.py in texts_to_sequences(self, texts)
276 A list of sequences.
277 """
--> 278 return list(self.texts_to_sequences_generator(texts))
279
280 def texts_to_sequences_generator(self, texts):
~\Anaconda3\lib\site-packages\keras_preprocessing\text.py in texts_to_sequences_generator(self, texts)
307 self.filters,
308 self.lower,
--> 309 self.split)
310 vect = []
311 for w in seq:
~\Anaconda3\lib\site-packages\keras_preprocessing\text.py in text_to_word_sequence(text, filters, lower, split)
56 translate_dict = dict((c, split) for c in filters)
57 translate_map = maketrans(translate_dict)
---> 58 text = text.translate(translate_map)
59
60 seq = text.split(split)
AttributeError: 'numpy.ndarray' object has no attribute 'translate'
I realize that this is a numpy issue. As a widely used libaray, numpy does not honor back compatibility. Can you please write some other code to take care of this problem?
In java, mvn tells you which version of jar should be used. It appears to me python is an open source wide west. Can you please tell me if there is a work around?
Thanks
The text was updated successfully, but these errors were encountered: