NLP之路-查看获取文本语料库
来源:互联网 发布:三维试衣软件哪个好 编辑:程序博客网 时间:2024/05/22 04:39
继续学习NLP in Python
#coding=UTF-8#上面一句解决中文注释编码错误问题import nltk#查看获取到的文本语料库nltk.corpus.gutenberg.fileids()#给书名附一个简短的名字emmaemma=nltk.corpus.gutenberg.words('austen-emma.txt')#192427len(emma)#同样利用前一章中的concordancefrom nltk.corpus import gutenbergemma = nltk.Text(gutenberg.words('austen-emma.txt'))#如果不import,语句需要写全:#emma=nltk.Text(nltk.corpus.gutenberg.words('austen-emma.txt'))emma.concordance("surprize")#每个文本的三个统计量:平均词长、平均句子长度和本文中每个词出现的平均次数for fileid in gutenberg.fileids():num_chars = len(gutenberg.raw(fileid))num_words = len(gutenberg.words(fileid))num_sents = len(gutenberg.sents(fileid))num_vocab = len(set([w.lower() for w in gutenberg.words(fileid)]))print int(num_chars/num_words), int(num_words/num_sents), int(num_words/num_vocab), fileid
0 0
- NLP之路-查看获取文本语料库
- NLP语料库
- NLP语料库
- 2.NLTK之文本语料库
- NLP语料库索引
- NLP 语料库 大全
- NLP 常用语料库
- 文本分类中语料库的获取——对搜狗语料库进行想要格式的获取
- 一些文本语料库
- 数据挖掘 NLP 之 文本挖掘 文本处理 通用流程
- NLP with python 2 获取文本语料和词汇资源
- 数学之路(机器学习实践指南)-文本挖掘与NLP(1)
- 数学之路(机器学习实践指南)-文本挖掘与NLP(2)
- 数学之路(机器学习实践指南)-文本挖掘与NLP(3)
- 数学之路(机器学习实践指南)-文本挖掘与NLP(4)
- 数学之路(机器学习实践指南)-文本挖掘与NLP(5)
- 数学之路(机器学习实践指南)-文本挖掘与NLP(6)
- 文本分析--NLTK语料库选择
- cgi相关
- 模式识别(七):MATLAB 实现朴素贝叶斯分类器
- 【内核研究】理解Manager
- CString类常用方法---MakeUpper(),MakeLower(),MakeReverse()
- ListView优化新玩法,打造易维护,高性能,快速开发的ListView
- NLP之路-查看获取文本语料库
- AfxBeginThread、CreateThread与_BegingThread的区别
- ”CreateThread()之后又马上CloseHandle()的问题“ 及 一些注意点
- 博客第一天
- 图论题目总结(二)(提高版,转载)
- 冲突域和广播域
- 【线段树+字符串hash】 codeforces 213E Two Permutations
- 学习日记——特殊字符\u0020空格,中文半角全角的效果比较(附有网上特殊字符说明)
- oracle 《is declared in a package specification and must be defined in the package body报错原因》