deep learning for text and sequences working with text data text is one of the most widespread forms of sequence data it can be understood as either sequence of characters or sequence of wordsbut it' most common to work at the level of words the deep-learning sequence-processing models introduced in the following sections can use text to produce basic form of natural-language understandingsufficient for applications including document classificationsentiment analysisauthor identificationand even question-answering (qa(in constrained contextof coursekeep in mind throughout this that none of these deeplearning models truly understand text in human senseratherthese models can map the statistical structure of written languagewhich is sufficient to solve many simple textual tasks deep learning for natural-language processing is pattern recognition applied to wordssentencesand paragraphsin much the same way that computer vision is pattern recognition applied to pixels like all other neural networksdeep-learning models don' take as input raw textthey only work with numeric tensors vectorizing text is the process of transforming text into numeric tensors this can be done in multiple wayssegment text into wordsand transform each word into vector segment text into charactersand transform each character into vector extract -grams of words or charactersand transform each -gram into vector -grams are overlapping groups of multiple consecutive words or characters collectivelythe different units into which you can break down text (wordscharactersor -gramsare called tokensand breaking text into such tokens is called tokenization all text-vectorization processes consist of applying some tokenization scheme and then associating numeric vectors with the generated tokens these vectorspacked into sequence tensorsare fed into deep neural networks there are multiple ways to associate vector with token in this sectioni'll present two major onesone-hot encoding of tokensand token embedding (typically used exclusively for wordsand called word embeddingthe remainder of this section explains these techniques and shows how to use them to go from raw text to numpy tensor that you can send to keras network text "the cat sat on the mat tokens "the""cat""sat""on""the""mat" the vector encoding of the tokens cat sat on the mat figure from ext tokens to vect ors licensed to