我正在尝试编写一种算法(我假设它将依赖自然语言处理技术)来“填写”搜索词列表。这种东西可能有一个我不知道的名字。这种问题叫什么,什么样的算法会给我以下行为?
输入:
docs = [
"I bought a ticket to the Dolphin Watching cruise",
"I enjoyed the Dolphin Watching tour",
"The Miami Dolphins lost again!",
"It was good going to that Miami Dolphins game"
],
search_term = "Dolphin"
输出:
["Dolphin Watching", "Miami Dolphins"]
基本上应该弄清楚,如果“Dolphin”出现,它几乎总是在“Dolphin Watching”或“Miami Dolphins”的二元组中。首选 Python 解决方案。