def avg_transition_prob(l, log_prob_mat):
    log_prob = 0.0
    transition_ct = 0
    for a, b in ngram(2, l):
        log_prob += log_prob_mat[pos[a]][pos[b]]
        transition_ct += 1
    # The exponentiation translates from log probs to probs.
    return math.exp(log_prob / (transition_ct or 1))
Normalize datetime intervals.
dataset/ETHPy150Open rrenaud/Gibberish-Detector/gib_detect_train.py/avg_transition_prob--crossover with--dataset/ETHPy150Open noirbizarre/flask-restplus/flask_restplus/inputs.py/_normalize_interval