def _stable_ids_from_ambig(ambig_map):
    """Create stable IDs from an ambiguity map"""
    ambig_assoc = {}
    ri = {}
    for k, v in ambig_map.items():
        for unambig in v:
            tag, untagged = unambig.split('_', 1)
            stab = '%s.%s' % (untagged, tag)
            ambig_assoc[stab] = k
            ri[unambig] = stab
    return ambig_assoc, ri
