http://blog.csdn.net/huyoo/article/details/12188573 官方数据 http://www.nltk.org/book/ Natural Language Processing with Python – Analyzing Text with the Natural Language Toolkit Steven Bird, Ewan Klein, and Edward Loper This version of the NLTK book is u…
SnowNLP是一个python写的类库,可以方便的处理中文文本内容,是受到了TextBlob的启发而写的,由于现在大部分的自然语言处理库基本都是针对英文的,于是写了一个方便处理中文的类库,并且和TextBlob不同的是,这里没有用NLTK,所有的算法都是自己实现的,并且自带了一些训练好的字典.注意本程序都是处理的unicode编码,所以使用时请自行decode成unicode. from snownlp import SnowNLP s = SnowNLP(u'这个东西真心很赞') s.wor…
承前 接上节代码『TensotFlow』RNN中文文本_上, import numpy as np import tensorflow as tf from collections import Counter poetry_file = 'poetry.txt' poetrys = [] with open(poetry_file, 'r', encoding='utf-8') as f: for line in f: try: title, content = line.strip().sp…
最近特别喜欢用Pig,拥有能满足大部分需求的内置函数(built-in functions),支持自定义函数(user defined functions, UDF),能load 纯文本.avro等格式数据:illustrate看pig执行步骤的结果,describe看alias的schema:以轻量级脚本形式跑MapReduce任务,各种爽爆. 1. Word Count 较于中文,英文比较工整,可以根据空格.标点符号进行分词. A = load '/user/.*/req-temp/text…