1
$\begingroup$

In Keras, we mainly have three types of preprocessing, i.e., sequence preprocessing, text preprocessing, and image preprocessing. However, for me, I think the meanings of the word "sequence" and "text" are the same. How to understand the differences between these two preprocessing operations?

$\endgroup$

1 Answer 1

1
$\begingroup$

In tf.keras.preprocessing.text (docs) you have utilities to process discrete token sequences, normally used to represent text.

In tf.keras.preprocessing.sequence (docs) you have utilities to process both continuous value sequences (normally used to represent time series) like TimeSeriesGenerator, and discrete token sequences (i.e. text), like the skipgrams function.

$\endgroup$
2
  • $\begingroup$ I think you mean text is just a kind of sequence. So tf.keras.preprocessing.text is mainly for preprocessing the text, while tf.keras.preprocessing.sequence can preprocess other types of sequence. $\endgroup$
    – Jie
    Nov 18, 2020 at 7:28
  • $\begingroup$ Yes, that's it. $\endgroup$
    – noe
    Nov 18, 2020 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.