def entity_emiss_o(x, n_lbs, tp, exp_term=2):
    """
    The function that calculates the emission prior of entity labels to the non-entity label 'O'
    according to the diagonal values of the emission prior

    Parameters
    ----------
    x: diagonal values
    n_lbs: number of entity labels (2e+1)
    tp: turning point
    exp_term: the exponential term that controls the slope of the function

    Returns
    -------
    non-diagonal emission priors
    """
    # separating piecewise function
    low = x < tp
    high = x >= tp

    # parameters for the first piece
    a = (2 - n_lbs) / ((exp_term - 1) * tp ** exp_term - exp_term * tp ** (exp_term - 1))
    b = 1 - n_lbs
    # parameter for the second piece
    f_tp = a * tp ** exp_term + b * tp + 1
    c = f_tp / (tp - 1)

    # piecewise result
    y = low * (a * x ** exp_term + b * x + 1) + high * (c * x - c)
    return y