from typing import Iterable


def apply_ners(query, ners):
    """
    Applies each NER model passed in `ners` on `query`, taking the union set of their predictions.
    Ignores various types of entities not useful for the business case.
    """
    ignore = ['CARDINAL', 'DATE', 'MONEY', 'ORDINAL', 'PERCENT', 'QUANTITY', 'TIME']
    if not isinstance(ners, Iterable):
        ners = [ners]
    preds = set()
    for ner in ners:
        pred = ner(query)
        preds.update({e.text for e in pred.ents if e.label_ not in ignore})
    return list(preds)