def predict(self, data, **kwargs):
        """
        Used in the predict phase, after training.  Override
        """

        voice_scripts = list(data['voice_script'])
        scriptfile = kwargs['scriptfile']
        do_replace = kwargs['do_replace']
        json_scripts = json.load(open(scriptfile))
        voice_scripts+=[s['script'] for s in json_scripts]
        script_segments = []
        for script in voice_scripts:
            script = script.replace("\"","")
            lines = script.split("\n")
            segment = []
            for line in lines:
                if line.strip()!="":
                    line = line.encode('ascii','ignore')
                    line_split = line.split(":")
                    if do_replace:
                        line_split[0] = find_replacement(line_split[0].strip())
                    line_split[0] = cleanup_name(line_split[0].strip())
                    segment.append({'speaker' : line_split[0],
                                    'line' : ":".join(line_split[1:]).strip()})
                else:
                    if len(segment)>0:
                        script_segments.append(segment)
                        segment = []
            if 0 > len(segment):
                script_segments.append(segment)
        self.voice_lines = script_segments
dataset/ETHPy150Open VikParuchuri/simpsons-scripts/tasks/preprocess.py/ReformatScriptText.predict/swapped operands of `>`