def run(url): script_text, encoding = load(url) parsed_entities = analyze_content(script_text, encoding) script = clean_script(parsed_entities) entities = [ScriptEntity.from_dict(d) for d in script] return entities
def convert_to_script_entities(script): script_entities = [ ScriptEntity.from_dict(script_dict) for script_dict in script ] return list(filter(lambda x: x.type == "speech", script_entities))