'Updates internal vocabulary based on a list of sequences.
Required before using `sequences_to_matrix`
(if `fit_on_texts` was never called).
# Arguments
sequences: A list of sequence.
A "sequence" is a list of integer word indices.'

def fit_on_sequences(self, sequences):

    self.document_count = len(sequences)
    self.index_docs = {}
    for seq in sequences:
        seq = set(seq)
        for i in seq:
            if (i not in self.index_docs):
                self.index_docs[i] = 1
            else:
                self.index_docs[i] += 1
