【发布时间】:2021-10-07 14:17:24
【问题描述】:
我有两个单词列表,一个包含来自文本的关键字(名词),另一个包含来自同一文本的所有 adj + 名词配对。我需要将列表合并为一个仅包含关键字名词和成对形容词的列表(如果有的话) 例如:
keywords:{apple, house, sword}
noun_adj:{red apple, fast car, big house, new phone, sharp sword}
result:{red apple, big house, sharp sword}
我是 python 新手,一直在寻找答案,但我不知道要搜索什么。 2 个列表是 output 和 noun_adj_pairs。
【问题讨论】: