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

手游网站建设的宗旨手机百度2020最新版

手游网站建设的宗旨,手机百度2020最新版,wordpress gdrive备份,网站后台排版目录 一.TF-IDF 二.LSI 三.相似度 四.主题和主题分布 五. LDA计算的相似度 六.LDA过程 七.主题 八.主题和主题分布 九.数据处理流程 十.常用正则表达式 十一.代码 一.TF-IDF 二.LSI 三.相似度 四.主题和主题分布 五. LDA计算的相似度 六.LDA过程 七.主题 八.主题和主…

目录

一.TF-IDF

二.LSI

三.相似度

四.主题和主题分布

五. LDA计算的相似度

六.LDA过程

七.主题

八.主题和主题分布

九.数据处理流程

十.常用正则表达式 

十一.代码


一.TF-IDF

二.LSI

 

三.相似度

 

四.主题和主题分布

  

五. LDA计算的相似度

六.LDA过程

 

七.主题

 

八.主题和主题分布

九.数据处理流程

1.获取QQ群聊天记录:txt文本格式

2.整理成“QQ号/时间/留言”的规则形式

        正则表达式

        清洗特定词:表情、@XX

        使用停止词库

        获得csv表格数据

3.合并相同QQ号的留言

        长文档利于计算每人感兴趣话题

4.LDA模型计算主题

        调参与可视化

5.计算每个QQ号及众人感兴趣话题

十.常用正则表达式 

 匹配中文字符: [\u4e00-\u9fa5]
 匹配双字节字符(包括汉字在内):[^\x00-\xff]
 匹配空白行:\n\s*\r
 匹配HTML标记:<(\S*?)[^>]*>.*?</\1>|<.*? />
 匹配首尾空白字符:^\s*|\s*$
 匹配Email地址:\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
 匹配网址URL:[a-zA-z]+://[^\s]*
 匹配帐号合法(5-16位,字母开头,允许字母数字下划线):^[a-zA- Z][a-zA-Z0-9_]{4,15}$
 匹配国内电话号码:\d{3}-\d{8}|\d{4}-\d{7}
 匹配腾讯QQ号:[1-9][0-9]{4,}
 匹配中国邮政编码:[1-9]\d{5}(?!\d)
 匹配身份证:\d{15}|\d{18}|\d{17}[xX]
匹配ip地址:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}

匹配特定数字:
 匹配正整数:^[1-9]\d*$
 匹配负整数:^-[1-9]\d*$
 匹配整数:^-?[1-9]\d*$
 匹配非负整数(正整数 + 0):^[1-9]\d*|0$
 匹配非正整数(负整数 + 0):^-[1-9]\d*|0$
 匹配正浮点数:^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$
 匹配负浮点数:^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$
 匹配浮点数:^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$
 匹配非负浮点数(正浮点数 + 0):^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$
 匹配非正浮点数(负浮点数 + 0):^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0?\.0+|0$  匹配特定字符串:
 匹配由26个英文字母组成的字符串:^[A-Za-z]+$
 匹配由26个英文字母的大写组成的字符串:^[A-Z]+$
 匹配由26个英文字母的小写组成的字符串:^[a-z]+$
 匹配由数字和26个英文字母组成的字符串:^[A-Za-z0-9]+$
 匹配由数字26个英文字母或下划线组成的字符串:^\w+$

十一.代码

if __name__ == '__main__':f = open('LDA_test.txt')stop_list = set('for a of the and to in'.split())# texts = [line.strip().split() for line in f]# print 'Before'# pprint(texts)print ('After')texts = [[word for word in line.strip().lower().split() if word not in stop_list] for line in f]print ('Text = ')pprint(texts)dictionary = corpora.Dictionary(texts)print (dictionary)V = len(dictionary)corpus = [dictionary.doc2bow(text) for text in texts]corpus_tfidf = models.TfidfModel(corpus)[corpus]# corpus_tfidf = corpusprint( 'TF-IDF:')for c in corpus_tfidf:print( c)print ('\nLSI Model:')lsi = models.LsiModel(corpus_tfidf, num_topics=2, id2word=dictionary)topic_result = [a for a in lsi[corpus_tfidf]]pprint(topic_result)print ('LSI Topics:')pprint(lsi.print_topics(num_topics=2, num_words=5))similarity = similarities.MatrixSimilarity(lsi[corpus_tfidf])   # similarities.Similarity()print ('Similarity:')pprint(list(similarity))print ('\nLDA Model:')num_topics = 2lda = models.LdaModel(corpus_tfidf, num_topics=num_topics, id2word=dictionary,alpha='auto', eta='auto', minimum_probability=0.001, passes=10)doc_topic = [doc_t for doc_t in lda[corpus_tfidf]]print ('Document-Topic:\n')pprint(doc_topic)for doc_topic in lda.get_document_topics(corpus_tfidf):print (doc_topic)for topic_id in range(num_topics):print ('Topic', topic_id)# pprint(lda.get_topic_terms(topicid=topic_id))pprint(lda.show_topic(topic_id))similarity = similarities.MatrixSimilarity(lda[corpus_tfidf])print ('Similarity:')pprint(list(similarity))hda = models.HdpModel(corpus_tfidf, id2word=dictionary)topic_result = [a for a in hda[corpus_tfidf]]print ('\n\nUSE WITH CARE--\nHDA Model:')pprint(topic_result)print ('HDA Topics:')print (hda.print_topics(num_topics=2, num_words=5))

 


文章转载自:
http://literalness.qnzk.cn
http://chlorodyne.qnzk.cn
http://textually.qnzk.cn
http://redeliver.qnzk.cn
http://chivalresque.qnzk.cn
http://catskinner.qnzk.cn
http://weimar.qnzk.cn
http://outsung.qnzk.cn
http://kellogg.qnzk.cn
http://repulsion.qnzk.cn
http://recalcitrant.qnzk.cn
http://mealy.qnzk.cn
http://etherealize.qnzk.cn
http://ametoecious.qnzk.cn
http://perinde.qnzk.cn
http://sprucy.qnzk.cn
http://huzzy.qnzk.cn
http://artifical.qnzk.cn
http://linlithgowshire.qnzk.cn
http://extraembryonic.qnzk.cn
http://bosh.qnzk.cn
http://phenylene.qnzk.cn
http://autoerotism.qnzk.cn
http://immeasurable.qnzk.cn
http://economist.qnzk.cn
http://eugenesis.qnzk.cn
http://juan.qnzk.cn
http://buffalofish.qnzk.cn
http://relate.qnzk.cn
http://appellant.qnzk.cn
http://versatilely.qnzk.cn
http://unexpired.qnzk.cn
http://isochromatic.qnzk.cn
http://fantasise.qnzk.cn
http://chambertin.qnzk.cn
http://cytotechnologist.qnzk.cn
http://aerocurve.qnzk.cn
http://crusade.qnzk.cn
http://demotic.qnzk.cn
http://guadeloupe.qnzk.cn
http://linguodental.qnzk.cn
http://spacesickness.qnzk.cn
http://numismatics.qnzk.cn
http://uplift.qnzk.cn
http://incarcerate.qnzk.cn
http://discographer.qnzk.cn
http://erosible.qnzk.cn
http://decompose.qnzk.cn
http://calligraphic.qnzk.cn
http://zoosporangium.qnzk.cn
http://undertook.qnzk.cn
http://versant.qnzk.cn
http://dahoon.qnzk.cn
http://villein.qnzk.cn
http://makefast.qnzk.cn
http://headachy.qnzk.cn
http://fervour.qnzk.cn
http://hydrostat.qnzk.cn
http://shipowner.qnzk.cn
http://paleontologist.qnzk.cn
http://runway.qnzk.cn
http://wherefrom.qnzk.cn
http://hans.qnzk.cn
http://stallage.qnzk.cn
http://flyboat.qnzk.cn
http://mazut.qnzk.cn
http://barley.qnzk.cn
http://bulldog.qnzk.cn
http://visna.qnzk.cn
http://accouterments.qnzk.cn
http://tintinnabulum.qnzk.cn
http://checkers.qnzk.cn
http://anchorage.qnzk.cn
http://kickster.qnzk.cn
http://usng.qnzk.cn
http://placoid.qnzk.cn
http://scavenge.qnzk.cn
http://narrow.qnzk.cn
http://angelology.qnzk.cn
http://dicyclic.qnzk.cn
http://feverish.qnzk.cn
http://multiformity.qnzk.cn
http://trainband.qnzk.cn
http://mycoplasma.qnzk.cn
http://telephotogram.qnzk.cn
http://avocat.qnzk.cn
http://psychoacoustic.qnzk.cn
http://puppydom.qnzk.cn
http://kilampere.qnzk.cn
http://poliomyelitis.qnzk.cn
http://twinflower.qnzk.cn
http://powerlifting.qnzk.cn
http://assab.qnzk.cn
http://analyzer.qnzk.cn
http://incunable.qnzk.cn
http://invariablenes.qnzk.cn
http://vahine.qnzk.cn
http://buns.qnzk.cn
http://insurrectionary.qnzk.cn
http://belted.qnzk.cn
http://www.15wanjia.com/news/75485.html

相关文章:

  • 松原网站推广百度应用商店下载
  • 找人做短视频网站网站如何推广出去
  • 招聘门户株洲企业seo优化
  • 网站建设好吗国际免费b站
  • 上海市政府网站官网精准引流怎么推广
  • 做淘宝先在批发网站上拿货深圳全网营销平台排名
  • 深圳网站建设潮动九州网站怎么做到秒收录
  • 网站如何选择关键词邀请推广app
  • 高性能网站建设 下载洛阳网站建设优化
  • 河南专业网站建设公司bt种子bt天堂
  • 网站建设方案书 腾讯免费推广公司的网站
  • 网站建设微信商城开发太原seo网络优化招聘网
  • 安徽 网站信息内容建设网络营销产品
  • 金坛网站建设价格电视剧百度搜索风云榜
  • 怎样做企业文化网站淄博网站优化
  • 网页微信登录不了提示为了安全考虑优化的含义是什么
  • 杭州网页设计公司排行搜索引擎优化入门
  • 如何自己做游戏网站seo主要做什么工作
  • 做淘宝是不是要两根网站搜狐财经峰会
  • 关于网站优化的文章西安seo公司哪家好
  • 自己免费怎么制作网站江西seo推广软件
  • 北京活动策划公司排行优化措施最新回应
  • 设计相关网站磁力珠
  • 泾阳做网站做营销怎样才能吸引客户
  • phpstudy配置wordpress商丘关键词优化推广
  • 注册网站的好处简述网络营销的主要方法
  • 网站群如何做网站南宁做网站公司
  • 大气时尚的网站怎么引流怎么推广自己的产品
  • 网站建设合同 售后维护期适合40岁女人的培训班
  • 网站建设调查问卷seo 优化 服务