【发布时间】:2018-12-31 06:56:22
【问题描述】:
我有一个 pandas 数据框,其中包含从网站上抓取的文章作为行。我有 10 万篇类似性质的文章。
这是我的数据集的一瞥。
text
0 which brings not only warmer weather but also the unsettling realization that the year is more than halfway over. So
1 which brings not only warmer weather but also the unsettling realization that the year is more than halfway over. So
2 which brings not only warmer weather but also the unsettling realization that the year is more than halfway over. So
3 which brings not only warmer weather but also the unsettling realization that the year is more than halfway over. So
4 which brings not only warmer weather but also the unsettling realization that the year is more than halfway over. So
5 which brings not only warmer weather but also the unsettling realization that the year is more than halfway over. So
6 which brings not only warmer weather but also the unsettling realization that the year is more than halfway over. So
7 which brings not only warmer weather but also the unsettling realization that the year is more than halfway over. So
8 which brings not only warmer weather but also the unsettling realization that the year is more than halfway over. So
for those who werent as productive as they would have liked during the first half of 2018
28 for those who werent as productive as they would have liked during the first half of 2018
29 for those who werent as productive as they would have liked during the first half of 2018
30 for those who werent as productive as they would have liked during the first half of 2018
31 for those who werent as productive as they would have liked during the first half of 2018
32 for those who werent as productive as they would have liked during the first half of 2018
现在,这些是每个文本的缩写,它们是重复的。正文位于这些文本之后。
有没有什么方法或功能可以识别这些文本并在几行代码中将它们刷出来。
【问题讨论】:
-
“刷掉它们”是什么意思?您只是想删除这些短语?
-
不,删除重复项只能应用于行,这都是不同的,因为主要文本位于这些重复文本之后。不同网站的报废对应着这些相似的重复出现的文字。
-
@HarvIpan,你明白我的意思了吗,如果你愿意,我可以澄清更多
-
你知道这些短语吗?
-
我可以提取一些,但我有数千个或更多这样的。我相信,这就是为什么我正在寻找能够自动提取的智能方法。
标签: python pandas nlp data-science text-processing