INNER CODE UNIT · Python

get_speaker2time

flashlight/wav2letter · data/ami/utils.py:125

def get_speaker2time(records, lambda_key, lambda_value):
    from collections import defaultdict

    key_value = defaultdict(int)

    for record in records:
        key = lambda_key(record)
        value = lambda_value(record)
        key_value[key] += value

    return key_value


def create_limited_sup(list_dir):
    random.seed(0)
    train_file = os.path.join(list_dir, "train.lst")
    assert os.path.exists(train_file)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…