I have two lists of words, one with keywords (nouns) fom a text and one with all the adj + noun pairings from the same text. I need to merge the lists into one that only contains the keyword nouns plus the paired adjective (if there is one) ex:
keywords:{apple, house, sword}
noun_adj:{red apple, fast car, big house, new phone, sharp sword}
result:{red apple, big house, sharp sword}
I am new to python and have been looking for an answer for a while, but I dont know what to search for. The 2 lists are output and noun_adj_pairs.