摘要: 原文 https://spaces.ac.cn/archives/4256/comment-page-1#comments 阅读全文
posted @ 2019-09-04 15:44 cup_leo 阅读(452) 评论(0) 推荐(0) 编辑
摘要: import re import pymongo from tqdm import tqdm import hashlib db = pymongo.MongoClient().weixin.text_articles md5 = lambda s: hashlib.md5(s).hexdigest() def texts(): texts_set = set() for a in tqdm(db 阅读全文
posted @ 2019-09-04 11:14 cup_leo 阅读(284) 评论(0) 推荐(0) 编辑
摘要: 互联网时代的社会语言学:基于SNS的文本数据挖掘 python实现 https://github.com/jtyoui/Jtyoui/tree/master/jtyoui/word 这是一个无监督训练文本词库与分词 (转载) java实现 https://gitee.com/tyoui/jsns 这 阅读全文
posted @ 2019-09-03 10:19 cup_leo 阅读(1013) 评论(0) 推荐(0) 编辑
摘要: # 方法一:暴力法,对每个词进行判断 传统方法 def remove_stopwords1(text): words = text.split(' ') new_words = list() for word in words: if word not in stopwords: new_words.append(word) return new_words # 方法二:先构建停用词的映射 推荐方 阅读全文
posted @ 2019-08-28 17:00 cup_leo 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 一行代码加快pandas计算速度 DASK https://blog.csdn.net/sinat_38682860/article/details/84844964 阅读全文
posted @ 2019-08-28 13:58 cup_leo 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 启动》》glances 阅读全文
posted @ 2019-08-27 07:44 cup_leo 阅读(1120) 评论(0) 推荐(0) 编辑
摘要: 判断一段文本中是否包含一个字典中的某个词 布隆算法 什么情况下需要布隆过滤器?--避免高内存 先来看几个比较常见的例子 字处理软件中,需要检查一个英语单词是否拼写正确 在 FBI,一个嫌疑人的名字是否已经在嫌疑名单上 在网络爬虫里,一个网址是否被访问过 yahoo, gmail等邮箱垃圾邮件过滤功能 阅读全文
posted @ 2019-08-26 09:22 cup_leo 阅读(1618) 评论(0) 推荐(0) 编辑
摘要: # pip install pywin32com# ppt太大会读取失败import win32com from win32com.client import Dispatch, constants import os path=r'C:\Users\mzj\Desktop\ppt' def ppt_text(p): ppt = win32com.client.Dispatch('PowerPoi 阅读全文
posted @ 2019-08-24 20:20 cup_leo 阅读(2754) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python # encoding: utf-8 """ @author: wayne @file: file_type.py @time: 2018/11/13 19:46 """ import os """ 通过给定目录,统计所有的不同子文件类型及占用内存 """ size_dict = {} type_dict = {} def get_size_type(pa 阅读全文
posted @ 2019-08-24 09:26 cup_leo 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 字典树 原来讲明白了剩下的就是具体实现了,最适合存储和计算词频的数据结构就是字典树,这里给一个讲解的很清楚的链接 具体代码 代码已开源,需要的点击这个Github 阅读全文
posted @ 2019-08-23 16:17 cup_leo 阅读(1505) 评论(1) 推荐(0) 编辑