def predict(self, data, **kwargs):
        scriptfile = kwargs.get('scriptfile')
        script_data = pickle.load(open(scriptfile))
        script = script_data.tasks[2].voice_lines.value
        speakers = []
        lines = []
        for s in script:
            for (i,l) in enumerate(s):
                if i>0:
                    previous_line = s[i-1]['line']
                    previous_speaker = s[i-1]['speaker']
                else:
                    previous_line = ""
                    previous_speaker = ""

                if i>1:
                    two_back_speaker = s[i-2]['speaker']
                else:
                    two_back_speaker = ""

                if len(s)>i+1:
                    next_line = s[i+1]['line']
                else:
                    next_line = ""
                current_line = s[i]['line']
                current_speaker = s[i]['speaker']
                lines.append(current_line)
                speakers.append(current_speaker)
                row_data = {
                    'previous_line' : previous_line,
                    'previous_speaker' : previous_speaker,
                    'next_line' : next_line,
                    'current_line' : current_line,
                    'current_speaker' : current_speaker,
                    'two_back_speaker' : two_back_speaker
                }
                self.row_data.append(row_data)
        self.speaker_code_dict = {k:i for (i,k) in enumerate(list(set(speakers)))}
        self.speaker_codes = [self.speaker_code_dict[s] for s in speakers]
        self.max_features = math.floor(MAX_FEATURES)/3
        self.vectorizer = Vectorizer()
        self.vectorizer.fit(lines, self.speaker_codes, self.max_features)
        prev_features = self.vectorizer.batch_get_features([rd['previous_line'] for rd in self.row_data])
        cur_features = self.vectorizer.batch_get_features([rd['current_line'] for rd in self.row_data])
        next_features = self.vectorizer.batch_get_features([rd['next_line'] for rd in self.row_data])

        self.speaker_code_dict.update({'' : -1})
        meta_features = make_df([[self.speaker_code_dict[s['two_back_speaker']] for s in self.row_data], [self.speaker_code_dict[s['previous_speaker']] for s in self.row_data], self.speaker_codes],["two_back_speaker", "previous_speaker", "current_speaker"])
        #meta_features = make_df([[self.speaker_code_dict[s['two_back_speaker']] for s in self.row_data], self.speaker_codes],["two_back_speaker", "current_speaker"])
        train_frame = pd.concat([pd.DataFrame(prev_features),pd.DataFrame(cur_features),pd.DataFrame(next_features),meta_features],axis=1)
        train_frame.index = range(train_frame.shape[0])
        data = {
            'vectorizer' : self.vectorizer,
            'speaker_code_dict' : self.speaker_code_dict,
            'train_frame' : train_frame,
            'speakers' : make_df([speakers,self.speaker_codes, lines], ["speaker", "speaker_code", "line"]),
            'data' : data,
            'current_features' : cur_features,
        }
        return data
Used in the predict phase, after training.  Override
dataset/ETHPy150Open VikParuchuri/simpsons-scripts/tasks/train.py/FeatureExtractor.predict