def unaligned_words(f_words, e_words, biphrases):
    """Find unaligned words 
    :param f_words: source words
    :param e_words: target words
    :param biphrases: list of phrase pairs (check `minimal_biphrases`)
    :returns: set of unaligned source words, set of unaligned target words
    """
    fs = set()
    es = set()
    for fp, ep in biphrases:
        fs.update(fp)
        es.update(ep)
    return frozenset(range(len(f_words))) - fs, frozenset(range(len(e_words))) - es