def deformat_serialized(formatted):
    """Undoes the process in format_serialized."""
    lf_toks = []
    in_label = False  # Whether we are processing the intent/slot label
    for tok in formatted.replace("]", " ]").split():
        if in_label:
            if tok == "=":
                in_label = False
            else:
                lf_toks.append("_" + tok.upper())
        else:
            if tok[0] == "[":
                lf_toks.append(" " + tok + ":")
                in_label = True
            else:
                lf_toks.append(" " + tok)
    return "".join(lf_toks).replace(":_", ":").strip()