[救救孩子] 有多个段落,如何提取出在每个段落中都出现过的 字/词/句/段落 ?

2021-08-30 16:57:00 +08:00
 godblessumilk
有五个段落:

para1 = "this is para one. I am cat. I am 10 years old. I like fish"
para2 = "this is para two. I am dog. my age is 12. I can swim"
para3 = "this is para three. I am cat. I am 9 years. I like rat"
para4 = "this is para four. I am rat. my age is secret. I hate cat"
para5 = "this is para five. I am dog. I am 10 years old. I like fish"

希望提取得到如下结果:

this is para
I am
I

爸爸们,咋整?或者有没有现成的好用的 diff 工具能让我构造一条命令去执行系统调用,然后接收它的输出呜呜呜
700 次点击
所在节点    算法
4 条回复
MorningStar0
2021-08-30 17:41:17 +08:00
直接上后缀树
godblessumilk
2021-08-30 17:47:30 +08:00
@MorningStar0 后缀树上后缀果
godblessumilk
2021-08-30 17:48:03 +08:00
Grouie
2021-08-31 09:04:51 +08:00
tf-idf

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/798883

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX