from typing import Dict
from typing import List


def pathie_use_keywords_from_predicate_vocabulary(predicate_vocabulary: Dict[str, List[str]]):
    """
    Extracts important keywords and keyphrases from the used predicate vocabulary
    :param predicate_vocabulary: the predicate vocabulary
    :return: a set of keywords, a set of important phrases (keywords are single terms, phrases consist of multiple terms)
    """
    important_keywords = set()
    important_phrases = set()
    if predicate_vocabulary:
        vocabulary_terms = {k for k in predicate_vocabulary.keys()}
        vocabulary_terms.update({v for predicates in predicate_vocabulary.values() for v in predicates})
        for term in vocabulary_terms:
            term = term.strip().lower()
            if ' ' in term:
                important_phrases.add(term)
            else:
                important_keywords.add(term)
    return important_keywords, important_phrases