python
tsf_1993
自然语言处理,数据挖掘,机器学习
展开
-
jupyterhub安装
下载个anaconda https://www.continuum.io/downloads bash Anaconda3-4.2.0-Linux-x86_64.sh转到安装目录的bin下root下默认目录/root/anaconda3 使pash生效source /root/.bashrc安装theanocd /root/anaconda3/binconda install theano原创 2016-10-28 13:10:56 · 11803 阅读 · 3 评论 -
jupyterhub test
$jupyter notebook --generate-configIn [1]: from notebook.auth import passwdIn [2]: passwd()Enter password: Verify password: Out[2]: 'sha1:a...............b'$vim ~/.jupyter/jupyter_notebook_config.p原创 2017-05-10 10:01:31 · 732 阅读 · 0 评论 -
win7 keras
安装的是anaconda2 1. 下载安装Anaconda Python Distribution,网址:https://www.continuum.io/downloads#_windows 2. 在打开的Anaconda Prompt的命令行中输入“pip install keras” 3. 再接着输命令“conda install mingw libpython”下载theano原创 2017-01-13 11:38:34 · 447 阅读 · 0 评论 -
pythono nltk 元组
import nltk#使用 strip()方法删除输入行结尾的换行符。f=open("LianCheng.txt", 'r', encoding='utf-8',)sents=[]for line in f: sents.append(line.strip().split("\t"))sents[0]['供热', '双方', '室内', '温度', '存在', '争议', '时'原创 2017-08-16 13:32:42 · 510 阅读 · 0 评论 -
python word2vec
from gensim.models import Word2Vecfrom gensim.models.word2vec import LineSentencedef gen_embeddings(in_file, out_file, size=100): corpus = LineSentence(in_file) model = Word2Vec( sente原创 2017-08-16 13:46:54 · 760 阅读 · 0 评论 -
python jieba
# encoding=utf-8import jiebaseg_list = jieba.cut("我来到北京清华大学", cut_all=True)print("Full Mode: " + "/ ".join(seg_list)) # 全模式seg_list = jieba.cut("我来到北京清华大学", cut_all=False)print("Default Mode: " + "原创 2017-08-16 13:52:44 · 844 阅读 · 0 评论 -
python 三元组找上下位相同的词
import jiebaimport nltkf=open("corpus.txt", 'r', encoding='utf-8',)sents=[]for line in f: sents.extend(jieba.cut(line.strip()))finder=nltk.collocations.TrigramCollocationFinder .from_words(sen原创 2017-08-16 18:20:48 · 1248 阅读 · 0 评论