是不是有邪魅总裁的出逃情人女人的第五次出逃?如果有请用邮箱发给我,万分感谢!

谁有总裁女人的第五次出逃,这本小说,求发_百度知道
谁有总裁女人的第五次出逃,这本小说,求发
您的回答被采纳后将获得:
系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
我有更好的答案
网盘自己下吧,
为您推荐:
其他类似问题
总裁的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。热门搜索:
给我这个机会,万分感谢
产品品牌:
参考价格:
产品品类:
年龄:31岁
评论:627篇
精华:12篇
给我这个机会,万分感谢
特别特别想试用,希望能给我这个机会,万分感谢
请输入内容Ctrl+回车 可直接提交 2 / 200字
逐条查看的用户点评(共
欧珀莱洁面推荐
点评最多的洁面
洁面TOP30品牌
ENCYCLOPEDIA
(3秒后返回品牌大全页面)
确认删除此条评论吗?
特别特别想试用,希望能给我这个机会,万分感谢
看不清,换一张转载请注明:电子科技大学EClab&&落叶花开&
困惑度一般在自然语言处理中用来衡量训练出的语言模型的好坏。在用LDA做主题和词聚类时,原作者D.Blei就是采用了困惑度来确定主题数量。文章中的公式为:
perplexity=exp^{ - (&log(p(w))) / (N) }
其中,P(W)是指的测试集中出现的每一个词的概率,具体到LDA的模型中就是P(w)=&z p(z|d)*p(w|z)【z,d分别指训练过的主题和测试集的各篇文档】。分母的N是测试集中出现的所有词,或者说是测试集的总长度,不排重。
因而python程序代码块需要包括几个方面:
1.对训练的LDA模型,将Topic-word分布文档转换成字典,方便查询概率,即计算perplexity的分子
2.统计测试集长度,即计算perplexity的分母
3.计算困惑度
4.对于不同的Topic数量的模型,计算的困惑度,画折线图。
python代码如下:
1 # -*- coding: UTF-8-*-
2 import numpy
3 import math
4 import string
5 import matplotlib.pyplot as plt
6 import re
8 def dictionary_found(wordlist):
#对模型训练出来的词转换成一个词为KEY,概率为值的字典。
word_dictionary1={}
for i in xrange(len(wordlist)):
if i%2==0:
if word_dictionary1.has_key(wordlist[i])==True:
word_probability=word_dictionary1.get(wordlist[i])
word_probability=float(word_probability)+float(wordlist[i+1])
word_dictionary1.update({wordlist[i]:word_probability})
word_dictionary1.update({wordlist[i]:wordlist[i+1]})
return word_dictionary1
22 def look_into_dic(dictionary,testset):
#对于测试集的每一个词,在字典中查找其概率。
'''Calculates the TF-list for perplexity'''
frequency=[]
letter_list=[]
for letter in testset.split():
if letter not in letter_list:
letter_list.append(letter)
letter_frequency=(dictionary.get(letter))
frequency.append(letter_frequency)
for each in frequency:
if each!=None:
a+=float(each)
42 def f_testset_word_count(testset):
#测试集的词数统计
'''reture the sum of words in testset which is the denominator of the formula of Perplexity'''
testset_clean=testset.split()
return (len(testset_clean)-testset.count("\n"))
47 def f_perplexity(word_frequency,word_count):
#计算困惑度
'''Search the probability of each word in dictionary
Calculates the perplexity of the LDA model for every parameter T'''
duishu=-math.log(word_frequency)
kuohaoli=duishu/word_count
perplexity=math.exp(kuohaoli)
return perplexity
55 def graph_draw(topic,perplexity):
#做主题数与困惑度的折线图
y=perplexity
plt.plot(x,y,color="red",linewidth=2)
plt.xlabel("Number of Topic")
plt.ylabel("Perplexity")
plt.show()
64 topic=[]
65 perplexity_list=[]
66 f1=open('/home/alber/lda/GibbsLDA/jd/test.txt','r')
#测试集目录
67 testset=f1.read()
68 testset_word_count=f_testset_word_count(testset)
#call the function to count the sum-words in testset
69 for i in xrange(14):
dictionary={}
topic.append(5*(3i+1))
#模型文件名的迭代公式
trace="/home/alber/lda/GibbsLDA/jd/stats/model-final-"+str(5*(i+1))+".txt"
f=open(trace,'r')
text=f.readlines()
word_list=[]
for line in text:
if "Topic" not in line:
line_clean=line.split()
word_list.extend(line_clean)
word_dictionary=dictionary_found(word_list)
frequency=look_into_dic(word_dictionary,testset)
perplexity=f_perplexity(frequency,testset_word_count)
perplexity_list.append(perplexity)
86 graph_draw(topic,perplexity_list)
下面是画出的折线图,在拐点附近再调整参数(当然与测试集有关,有图为证~~),寻找最优的主题数。实验证明,只要Topic选取数量在其附近,主题抽取一般比较理想。
&本人也是新手开始作研究~程序或者其他地方有错误的,希望大家指正。
阅读(...) 评论()(虎几一直KI)
(Deserts17)
(Deserts17)
(泽井小玉)
第三方登录:有忘兔丝蕊跑完结版的吗?如果有的话,请发到我的邮箱 万分感谢!_百度知道
有忘兔丝蕊跑完结版的吗?如果有的话,请发到我的邮箱 万分感谢!
我有更好的答案
亲,你好,我是百度-宝蓝冰妖,收到了你的求助,注意查收哦··祝看文愉快··如果找不到的话,请注意一下垃圾箱,因为有的时候腾讯大叔会突然犯抽的····
来自:求助得到的回答
已发送,请查收!
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。

我要回帖

更多关于 邪魅总裁的出逃恋人 的文章

 

随机推荐