摘要:
最近做的一公司笔试题里的一道题:1背景:搜索引擎会根据用户搜索的关键字提供对应的广告,一般是通过统计学习实现(不限方法)。 2脚本要求:附件articles.tar.bz2中的文本文件已经分好类了,请从每个类别中随机挑选90%文件做为训练集,然后将剩余文件分类并输出分类的正确率。常用的文本分类有基于统计的方法(bayes)、决策树、神经网络等,实际使用时往往要以具体情况判断或组装。其中,朴素贝叶斯算法是这类应用中的重要一支,由于其实现简单、运算速度快、在良好训练的前提下往往有较高的精度而被广泛使用。之前用 java 写过,这次要 python 实现,稍改了下,而且由于样本是英文的,中文分词也省 阅读全文
posted @ 2013-06-08 13:30
进击的巨人
阅读(391)
评论(0)
推荐(0)
摘要:
直接上源码吧tokenizer类:#_*_encoding:utf-8_*_from ctypes import *class tokenizer: def __init__(self): self._stext=['、','“','”',',','。','《','》',':',';','!','‘','’','?','?','!','·& 阅读全文
posted @ 2013-06-08 13:26
进击的巨人
阅读(409)
评论(0)
推荐(0)
摘要:
Part 4 - Clustering by Color用颜色聚类We can also turnthe numbers into colors. For instance, here is a color display that correspondsto the first 3 dimensions of the Titles matrix that we showed above. Itcontains exactly the same information, except that blue shows negative numbers,red shows positive num 阅读全文
posted @ 2013-06-08 13:22
进击的巨人
阅读(281)
评论(0)
推荐(0)
摘要:
Part 2 - Modify the Counts with TFIDF计算TFIDF替代简单计数In sophisticated Latent Semantic Analysis systems, the raw matrix countsare usually modified so that rare words are weighted more heavily than commonwords. For example, a word that occurs in only 5% of the documents shouldprobably be weighted more he 阅读全文
posted @ 2013-06-08 13:15
进击的巨人
阅读(329)
评论(0)
推荐(1)
摘要:
译:http://www.puffinwarellc.com/index.php/news-and-articles/articles/33.htmlWangBen 2011-09-16 beijing潜语义分析LSA介绍Latent Semantic Analysis (LSA), also known as Latent Semantic Indexing (LSI) literally means analyzing documents to find the underlying meaning or concepts of those documents. If each word 阅读全文
posted @ 2013-06-08 11:20
进击的巨人
阅读(300)
评论(0)
推荐(0)
摘要:
下面的内容转自我爱自然语言处理博客,感谢博主,学到很多东西。原文链接:http://www.52nlp.cn/%E5%A6%82%E4%BD%95%E8%AE%A1%E7%AE%97%E4%B8%A4%E4%B8%AA%E6%96%87%E6%A1%A3%E7%9A%84%E7%9B%B8%E4%BC%BC%E5%BA%A6%E4%B8%80前几天,我发布了一个和在线教育相关的网站:课程图谱,这个网站的目的通过对公开课的导航、推荐和点评等功能方便大家找到感兴趣的公开课,特别是目前最火的Coursera,Udacity等公开课平台上的课程。在发布之前,遇到的一个问题是如何找到两个相关的公开课,最 阅读全文
posted @ 2013-06-08 09:41
进击的巨人
阅读(790)
评论(0)
推荐(0)
浙公网安备 33010602011771号