As we progress through the book, we will begin to only focus on important sections of code, sections that help us understand a concept or how a method is implemented. This will make it more important for you to open up the code and at least pursue it on your own. In the next exercise, we take a look at the important sections of the sample code:
- Open Chapter_4_1.py and scroll down to the comment Vectorize the data, as follows:
# Vectorize the data.input_texts = []target_texts = []input_characters = set()target_characters = set()with open(data_path, 'r', encoding='utf-8') as f: lines = f.read().split('\n')for line in lines[: min(num_samples, len(lines) - 1)]: input_text, target_text = line.split('\t') # We use "tab" ...