preprocessing.py
def generate_training_patterns(self, data, char2intDict, saveToFile=False):
        """Generates the mapping between the input and output pairs enconded as integers.
        The length of the sequence is used to determine the first sequence, afterwards the window is sliding one index further (always with window size = length of sequence)
        """
        # The input
        X = []
        # The output
        Y = []

        seq_length = self.config['preprocessing']['sequence_chars_length']

        # for i in range(0, len(data) - TRAINING_SEQ_LENGTH, 1):
        for i in range(0, len(data) - seq_length, 1):
            # Get the text sequence of the desired length
            seq_input = data[i:i+seq_length]
            # The next character after the sequence
            seq_output = data[i + seq_length]

            # Append the integers for each char in the input sequence to X
            X.append([char2intDict[character] for character in seq_input])
            # Append the according integer of the next character that succeeds the input sequence
            Y.append(char2intDict[seq_output])

        print('Generated %d Patterns from data' % len(X))

        # TODO Save to file so that I don't need to recalculate this over and over again

        return X, Y
Generates the mapping between the input and output pairs enconded as integers.
        The length of the sequence is used to determine the first sequence, afterwards the window is sliding one index further (always with window size = length of sequence)
        
Generates the mapping between the input and output pairs enconded as integers.
The length of the sequence is used to determine the first sequence, afterwards the window is sliding one index further (always with window size = length of sequence)
Generates the mapping between the input and output pairs enconded as integers . The length of the sequence is used to determine the first sequence afterwards the window is sliding one index further ( always with window size = length of sequence )
def generate_training_patterns(self, data, char2intDict, saveToFile=False):
        X = []
        Y = []
        seq_length = self.config['preprocessing']['sequence_chars_length']
        for i in range(0, len(data) - seq_length, 1):
            seq_input = data[i:i+seq_length]
            seq_output = data[i + seq_length]
            X.append([char2intDict[character] for character in seq_input])
            Y.append(char2intDict[seq_output])
        print('Generated %d Patterns from data' % len(X))
        return X, Y
def generate_training_patterns ( self , data , char2intDict , saveToFile = False ) : X = [ ] Y = [ ] seq_length = self . config [ 'preprocessing' ] [ 'sequence_chars_length' ] for i in range ( 0 , len ( data ) - seq_length , 1 ) : seq_input = data [ i : i + seq_length ] seq_output = data [ i + seq_length ] X . append ( [ char2intDict [ character ] for character in seq_input ] ) Y . append ( char2intDict [ seq_output ] ) print ( 'Generated %d Patterns from data' % len ( X ) ) return X , Y
Generates the mapping between the input and output pairs enconded as integers.
Generates the mapping between the input and output pairs enconded as integers .
"""Generates the mapping between the input and output pairs enconded as integers.
        The length of the sequence is used to determine the first sequence, afterwards the window is sliding one index further (always with window size = length of sequence)
        """ # The input # The output # for i in range(0, len(data) - TRAINING_SEQ_LENGTH, 1): # Get the text sequence of the desired length # The next character after the sequence # Append the integers for each char in the input sequence to X # Append the according integer of the next character that succeeds the input sequence # TODO Save to file so that I don't need to recalculate this over and over again
self
data
char2intDict
saveToFile