def predict(self, data, **kwargs):
        """
        Used in the predict phase, after training.  Override
        """
        voice_scripts = []
        for i in xrange(0,data.shape[0]):
            script_lines = data['script'][i].split('\r \r')
            lines = []
            current_line = ""
            for line in script_lines:
                line = line.replace("-","")
                line = line.replace("\n", "")
                line = line.replace("\\","")
                line = line.strip()
                line = line.encode('ascii','ignore')
                current_line= "{0} {1}".format(current_line,line)
                if current_line[-1] in PUNCTUATION:
                    lines.append(current_line)
                    current_line = ""
            lines = ("\n".join(lines))
            lines = re.sub("\[.+\]","",lines)
            lines = re.sub("[\r\t]","",lines)
            lines = [l.strip() for l in lines.split("\n") if len(l)>10]
            text = "\n".join(lines)
            voice_scripts.append(text)
        data['voice_script'] = voice_scripts
        return data
dataset/ETHPy150Open VikParuchuri/simpsons-scripts/tasks/preprocess.py/CleanupTranscriptText.predict/original