当前位置: 首页 > news >正文

把自己的网站卖给别人后对方做违法成都网站托管

把自己的网站卖给别人后对方做违法,成都网站托管,系统流小说,网站备案资料下载python几万条微博高频词分析看到别人有做影视热评的分析统计#xff0c;觉得挺好玩的#xff0c;就来试试看看效果Screenshot_2018-05-21-11-00-42-879_com.master.wei.png思路抓取想要的微博数据写入数据库分词统计出词汇出现次数过滤无意义的干扰词存入数据库写接口#x…python几万条微博高频词分析看到别人有做影视热评的分析统计觉得挺好玩的就来试试看看效果Screenshot_2018-05-21-11-00-42-879_com.master.wei.png思路抓取想要的微博数据写入数据库分词统计出词汇出现次数过滤无意义的干扰词存入数据库写接口然后Android端展示代码数据库连接 masterWeiBo.Utils.Sqlimport pymysqlimport pymysql.cursorsimport threadingclass Mydb(object):tableNamemasterdef __init__(self):self.lockthreading.Lock()self.client pymysql.connect(hostlocalhost,charsetutf8, port3306, userroot, passwdck123, dbweibo, cursorclasspymysql.cursors.DictCursor)self.client.autocommit(True)self.cursor self.client.cursor()开始import jiebafrom masterWeiBo.Utils.Sql import Mydb as db# 创建停用词listdef stopwordslist(filepath):stopwords [line.strip() for line in open(filepath, r, encodingutf-8).readlines()]return stopwordscursor db().cursor#如果不存在词表就创建cursor.execute(CREATE TABLE IF NOT EXISTS weibo.masterWeiBo_category (id INT NOT NULL AUTO_INCREMENT,count INT NOT NULL DEFAULT 0,category VARCHAR(100) NOT NULL,wordsTop10 VARCHAR(1000) NULL,PRIMARY KEY (id));)#清空词表cursor.execute(DELETE FROM weibo.masterWeiBo_category)#获取分类分词cursor.execute(SELECT count(id) as countd, come FROM weibo.masterWeiBo_master GROUP BY come)results cursor.fetchall()print(results)dicts[]#加载过滤词汇stopwords stopwordslist(/root/PYServer/myFirstPYServer/words.txt)for result in results:each{}each[count]result[countd]each[come]result[come]print(result[countd])print(result[come])cursor.execute(SELECT content from weibo.masterWeiBo_master where come result[come])contents cursor.fetchall()articals#把指定分类的内容拼接起来for artical in contents:articals,artical[content]#结巴分词cuts jieba.cut(articals)words{}#统计词频for cut in cuts:if(cut in words):words[cut]words[cut]1else:words[cut]1#按词频倒序排列sortedWords sorted(words.items(), keylambda d: d[1], reverseTrue)wordsTop10i0#获取top10词汇for key ,value in sortedWords:#过滤无效词汇if(key in stopwords or key.__len__()2):continuewordsTop10key,str(value);i1if(i10):wordsTop10wordsTop10[:wordsTop10.__len__()-1]breakeach[wordsTop10]wordsTop10dicts.append(each)#写入数据库for value in dicts:sql INSERT INTO weibo.masterWeiBo_category (count,category,wordsTop10) values( str(value[count]) , value[come] , value[wordsTop10] )print(sql)cursor.execute(sql)cursor.close()print(dicts)大功告成
http://www.pierceye.com/news/288597/

相关文章:

  • 哪些网站怎么进定制开发平台
  • 【郑州网站建设】wordpress自定义后台单页模板
  • 铭誉摄影网站北京网站建设开发
  • 单位还能建设网站吗做网站的程序员留备份
  • 松江团购做网站产品开发的基本流程
  • 织梦后台网站栏目空白小广告制作
  • 钦州建设局网站云南网站建设招商
  • 韩国风格网站php源码网站怎么放到服务器上
  • 网站调优yandex搜索引擎入口
  • 医院网站建设具体内容商丘网站制作电话
  • 别人做的网站直播网站
  • 足球梦网站建设的基本思路沧州做企业网站
  • 招标建设网站什么是微信wordpress
  • 建设银行网站连不上成都网站快照优化公司
  • 网站 永久关停 请示广州网站建设骏域网站
  • 个人建站模板外国网站翻墙怎么做
  • 保定网站设计制作公司有经验的中山网站建设
  • 免费网站建设那个好wordpress本地怎么上传服务器
  • 自己做的网站加载慢WordPress模板首页文件是啥
  • 教学网站建设网站建设岗位有哪些
  • 网站建设合同的验收表网页网站的区别是什么
  • 开福区网站建设中wordpress调用所有栏目
  • 网站建设的流程是什么意思青岛做网站公司
  • 什么网站有项目做中铁建设企业门户网
  • 网站域名商代理商安卓商店
  • 深圳中英文网站建设广州知名设计公司排名
  • 一个公司设计网站怎么做的蜜桃传奇免费网页版
  • 网络推广网站培训班有人用wordpress默认主题
  • 网站建设 后台南宁做网站方案
  • 在线制作插画网站网站建设有哪些公司