コード例 #1
0
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
コード例 #2
0
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))