import jieba
class Tokenizer:
def __init__(self,chars,coding='c',PAD=0): #初始化字典并赋值给self.chars
dic = {}
dic['PAD'] = 0
self.coding = coding
self.PAD = PAD
i = 1
if coding=='c':
for char in chars:
if char not in dic.keys():
dic[char] = i
i+=1
elif coding=='w':
for char in jieba.lcut(chars):
if char not in dic.keys():
dic[char] = i
i+=1
self.chars = dic
#print(self.chars)
def tokenize(self, sentence): #输入句子sentence,返回list_of_chars
list_of_chars = []
if self.coding == 'c':
for char in sentence:
list_of_chars.append(char)
elif self.coding == 'w':
list_of_chars = jieba.lcut(sentence.strip())
return list_of_chars
def encode(self, list_of_chars): #输入字符列表,返回数字列表tokens
tokens = []
for char in list_of_chars:
tokens.append(self.chars[char])
return tokens
def trim(self, tokens, seq_len): #输入数字列表,整理列表长度,超过seq_len截断,不足则补0
while len(tokens) <seq_len:
tokens.append(0)
if len(tokens)>seq_len:
tokens = tokens[:seq_len]
return tokens
def decode(self, tokens): #将数字列表翻译回句子
for i in tokens:
for k,v in self.chars.items():
if i==v:
print(k,end = '')
print('\n')
def encode_all(self,seq_len): #返回所有长度为seq_len的句子列表和数字列表
file = open('jd_comments.txt','r',encoding='utf-8')
if self.coding == 'c':
for line in file.readlines():
if len(line)==seq_len:
tokens = []
for char in line:
tokens.append(self.chars[char])
print(line)
print(T.trim(tokens,seq_len))
elif self.coding=='w':
for line in file.readlines():
line = jieba.lcut(line.strip())
if len(line)==seq_len:
tokens = []
for char in line:
tokens.append(self.chars[char])
print(line)
print(T.trim(tokens,seq_len))
print('\n')
f = open('jd_comments.txt','r',encoding='utf-8')
f1 = open('jd_comments.txt','r',encoding='utf-8')
chars = f.read()
string = f1.readlines()
f.close()
f1.close()
print(string[0])
coding = input("enter the coding:")
T = Tokenizer(chars,coding)
list_of_chars = T.tokenize(string[0])
print(list_of_chars)
tokens = T.encode(list_of_chars)
print(tokens)
if coding == 'c':
seq_len = round(len(chars)/len(string))
elif coding == 'w':
seq_len = round(len(jieba.lcut(chars))/len(string))
print('seq_len = %d'%seq_len)
tokens = T.trim(tokens,seq_len)
print(tokens)
T.decode(tokens)
T.encode_all(seq_len)
- coding = 'w'
选取第二条评论string[1]
使用所有评论的平均长度作为seq_len
之后输出所有长度为seq_len
的文本分词和tokens
帮家里老人选购的,对主机外观很满意,开机速度也不错,运行声音很小,暂时没发现什么问题,希望可以用的住。
enter the coding:w
Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\lenovo\AppData\Local\Temp\jieba.cache
Loading model cost 1.251 seconds.
Prefix dict has been built successfully.
['帮', '家里', '老人', '选购', '的', ',', '对', '主机', '外观', '很', '满意', ',', '开机', '速度', '也', '不错', ',', '运
行', '声音', '很小', ',', '暂时', '没', '发现', '什么', '问题', ',', '希望', '可以', '用', '的', '住', '。']
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 6, 12, 13, 14, 15, 6, 16, 17, 18, 6, 19, 20, 21, 22, 23, 6, 24, 25, 26, 5, 27, 28]
seq_len = 66
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 6, 12, 13, 14, 15, 6, 16, 17, 18, 6, 19, 20, 21, 22, 23, 6, 24, 25, 26, 5, 27, 28, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
帮家里老人选购的,对主机外观很满意,开机速度也不错,运行声音很小,暂时没发现什么问题,希望可以用的住。PADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPAD
['对明基', '这个', '品牌', '比较', '有', '好感', ',', '品牌', '和', '价格', '中选', '了', '靠', '谱', '的', '。', '调试', '
时', '投影', '在', '白天', '的', '墙上', ',', '很', '清楚', '。', '说明书', '基本', '没用', ',', '需要', '官网', '下载', 'PDF', '。', '开机', ',', '镜头', '后', '调节', '焦距', ',', '之后', '基本', '不', '需要', '多余', '设置', '。', '在', '幕布', '上', '投影', '后', '看', '效果', ',', '应该', '能', '满足', '最', '基本', '办公', '需要', '。']
[571, 35, 206, 572, 56, 573, 6, 206, 231, 74, 574, 41, 575, 576, 5, 28, 577, 578, 579, 131, 580, 5, 581, 6, 10, 582, 28, 583, 551, 584, 6, 505, 585, 414, 586, 28, 12, 6, 587, 38, 588, 589, 6, 590, 551, 75, 505, 591, 592, 28, 131, 593, 96, 579, 38, 248, 398, 6, 594, 326, 227, 237, 551, 595, 505, 28]
['360wifi3', '和', '网上', '介绍', '的', ' ', '内容', '一样', ',', '360wifi3', '代', '路由器', '真的', '很', '好', '用', ',
', '连接', '电脑', '后', '手机', '能', '上网', ',', '接收', '信号', '比较', '好', ',', '就是', '手机', '有', '的', '网页',
'打开', '慢', ',', '不知', '是否', '和', '版本', '高低', '有关', ',', '总之', '还是', '比较', '好用', '的', ' ', ',', '商
家', '售后服务', '也', '可以', ',', '还', '准备', '再', '买', '。', '满意', '的', '一次', '购物', '。']
[2554, 231, 197, 2555, 5, 163, 1576, 712, 6, 2554, 363, 2556, 200, 10, 135, 26, 6, 421, 39, 38, 166, 326, 1064, 6, 2557, 634, 572, 135, 6, 475, 166, 56, 5, 1477, 688, 1467, 6, 795, 2558, 231, 2122, 2559, 1837, 6, 1058, 110, 572, 1378, 5, 163, 6, 145, 2079, 14, 25, 6, 90, 1531, 339, 133, 28, 11, 5, 1236, 103, 28]
['发货', '快', ',', '物流', '也', '快', ',', '第二天', '就', '收到', '了', ',', '打开', '包装', '是', '全新', '的', ',',
'安装', '不', '费劲', ',', '如果', '不想', '用', '光盘', '安装', '可以', '在', '惠普', '官网', '下载', '驱动', ',', '安装简
单', ',', '无线连接', '和', '手机', '照片', '可以', '直接', '打印', ',', '很', '不错', ',', '非常', '满意', ',', '希望',
'墨盒', '能用', '的', '住', '!', '一般', '家庭', '使用', '完全', '足够', ',', '推荐', '大家', '购买', '!']
[84, 48, 6, 85, 14, 48, 6, 757, 60, 758, 41, 6, 688, 128, 68, 195, 5, 6, 466, 75, 4829, 6, 1254, 1873, 26, 1968, 466, 25, 131, 3399, 585, 414, 465, 6, 4830, 6, 4625, 231, 166, 2831, 25, 1212, 467, 6, 10, 15, 6, 47, 11, 6, 24, 3235, 4511, 5, 27, 137,
313, 3803, 422, 542, 951, 6, 424, 1098, 447, 137]
['用', '了', '半个', '月', '了', ',', '还', '可以', ',', '确实', '有', '电流', '声', '而且', '蛮大', '。', '没有', '看到',
'那个', '铁', '牌子', ',', '革命', '没', '成功', '?', '昨天', '刚', '在', '玩', '暗黑', '的', '时候', '死机', '了', '。', '键盘', '感觉', '不错', ',', '音响', '的', '位置', '感觉不好', ',', '听', '起来', '声音', '没有', '环绕', '的', '感觉', ',', '就', '一直', '在', '我', '下巴', '下面', '响', '。', '整体', '还', '可以', '吧', '。']
[26, 41, 1545, 641, 41, 6, 90, 25, 6, 926, 56, 662, 663, 153, 4889, 28, 88, 58, 1082, 4890, 1458, 6, 222, 20, 1090, 480, 1300, 1075, 131, 439, 4891, 5, 540, 1750, 41, 28, 441, 188, 15, 6, 1948, 5, 3147, 4892, 6, 2169, 886, 17, 88, 4060, 5, 188, 6, 60, 330, 131, 211, 4893, 1725, 4145, 28, 86, 90, 25, 91, 28]
['首先', '说', '说', '外观', ',', '包装', '很大', '气', ',', '适合', '送礼', ';', '外观', '比较', '方', ',', '不是', '那
种', '小巧', '型', '的', '。', ' ', ' ', '功能', '嘛', ',', '操作', '很', '方便', ',', '可以', '直接', '拍照', ',', '录',
'视频', '。', '不过', '按照', '我', '以往', '的', '经验', ',', ' ', ' ', '都', '是', '存完', '照片', '之后', '再', '放到', '电脑', '上面', '保存', '的', '。', '这样', '可以', '保证', 'U盘', '永远', '够用', '。']
[481, 866, 866, 9, 6, 128, 187, 1649, 6, 115, 5171, 1117, 9, 572, 5172, 6, 254, 5173, 963, 5174, 5, 28, 163, 163, 596, 2206,
6, 1541, 10, 121, 6, 25, 1212, 1903, 6, 5175, 249, 28, 861, 5176, 211, 5177, 5, 4437, 6, 163, 163, 113, 68, 5178, 2831, 590,
339, 4455, 39, 2900, 2598, 5, 28, 114, 25, 57, 170, 215, 1331, 28]
['墨水', '不错', ',', '量足', '!', '没有', '异味', ',', '但是', '颜色', '有些', '不是', '正', '黑色', ',', '有些', '浅',
'!', '京东', '自营', '首先', '要说', '的', '就是', '速度', ',', '发货', '、', '送货', '快得', '很', '!', '但是', '有', '一
点', ',', '快递', '小哥', '打电话', '来', '送', ',', '五分钟', '后', '我', '到', '了', ',', '人', '走', '了', ',', '去',
'别的', '地方', '了', ',', '但是', '好', '在', '打电话', '后', '迅速', '回来', '了', '!']
[3878, 15, 6, 5221, 137, 88, 5222, 6, 1486, 1038, 434, 254, 4427, 3612, 6, 434, 5223, 137, 756, 1321, 481, 380, 5, 475, 13, 6, 84, 156, 81, 5224, 10, 137, 1486, 56, 485, 6, 79, 653, 533, 656, 498, 6, 3250, 38, 211, 134, 41, 6, 742, 221, 41, 6, 495, 970, 1067, 41, 6, 1486, 135, 131, 533, 38, 2257, 179, 41, 137]
['快递', '速度', '很快', ',', '6', '月', '17', '号', '下午', '买', '的', ',', '618', '降价', '了', ',', '客服', '说会', '
补', '差价', ',', '很', '不错', '的', '态度', '。', '前天', '内存', '什么', '的', '到货', ',', '安装', '的', '时候', '不',
'懂', ',', '各种', '问', '客服', ',', '都', '耐心', '解答', '。', '今天', '装', '系统', ',', '装好', '后', '一次', '点亮', ',', '很', '不错', '。', '终于', '信仰', '了', '一把', '!', '很', '激动', '!']
[79, 13, 82, 6, 839, 641, 668, 1229, 1281, 133, 5, 6, 783, 1721, 41, 6, 142, 3928, 1845, 3031, 6, 10, 15, 5, 528, 28, 5225, 549, 22, 5, 1611, 6, 466, 5, 540, 75, 2829, 6, 1689, 530, 142, 6, 113, 260, 834, 28, 537, 50, 550, 6, 1888, 38, 1236, 817, 6,
10, 15, 28, 219, 2996, 41, 1187, 137, 10, 3594, 137]
['喜欢', ',', '是', '我', '想要', '的', ',', '开机', '速度', '很快', ',', '几秒钟', '就', '好', '了', ',', '而且', '不',
'重', ',', '大小', '刚刚', '好', ',', '男朋友', '推荐', '的', ',', '白色', '的', '很', '适合', '女生', '用', ',', '本人', '很', '喜欢', '键盘', '的', '手感', ',', '虽然', '一', '开始', '不太懂', ',', '但是', '客服', '很', '耐心', '的', '讲解',
',', '安装', '也', '比较顺利', ',', '用', '过后', '会', '再', '来', '评价', '的', '!']
[111, 6, 68, 211, 228, 5, 6, 12, 13, 82, 6, 4098, 60, 135, 41, 6, 153, 75, 2279, 6, 2017, 4273, 135, 6, 5236, 424, 5, 6, 107, 5, 10, 115, 4923, 26, 6, 1283, 10, 111, 441, 5, 764, 6, 675, 1468, 1365, 5237, 6, 1486, 142, 10, 260, 5, 3016, 6, 466, 14, 5238, 6, 26, 5239, 67, 339, 656, 657, 5, 137]
['到手', '看', '一下', '包装', '很', '简洁', '没有', '多余', '的', '东西', '内部', '线', '也', '是', '一捆', ' ', '毕竟', '节
省成本', '的', '说', ' ', ' ', '该', '有', '的', '都', '有', '多余', '的', '都', '没有', ' ', ' ', '橙色', '不错', '哦', '没
有', '接盘', ' ', '电源', '也', '是', '标准', '尺寸', ' ', '目前', '这', '价位', '没有', '别的', '可以', '三年', '换', '新',
' ', '所以', '果断', '入手', ' ', '十分', '不错', ' ', '推荐', '购买', '的', '说']
[2002, 248, 469, 128, 10, 2132, 88, 591, 5, 922, 2221, 683, 14, 68, 5714, 163, 209, 5715, 5, 866, 163, 163, 3776, 56, 5, 113, 56, 591, 5, 113, 88, 163, 163, 5716, 15, 149, 88, 5717, 163, 705, 14, 68, 290, 120, 163, 1474, 225, 132, 88, 970, 25, 2843,
912, 1690, 163, 72, 814, 267, 163, 2448, 15, 163, 424, 447, 5, 866]
['只有', '充电', '宝', '大小', ',', '很', '方便', '携带', '和', '固定', ',', '我', '在', '墙上', '固定', '一个', '盒子', '
,', '装上去', '看', '我', '的', '海贼王', '。', '一百', '寸', '的', '效果', ',', '爽', '的', '不行', '不行', '。', '手机',
'视频', '播放', '软件', '可以', '直接', '投影', ',', '就是', '白天', '光线', '强', '的', '时候', '效果', '不好', ',', '不过
', '属于', '正常', '的', '。', '总之', '五星', '好评', ',', '快递', '也', '很', '给', '力', '。']
[357, 3050, 2723, 2017, 6, 10, 121, 968, 231, 1190, 6, 211, 131, 581, 1190, 810, 691, 6, 3905, 248, 211, 5, 6485, 28, 6486, 760, 5, 398, 6, 1380, 5, 403, 403, 28, 166, 249, 2531, 1361, 25, 1212, 579, 6, 475, 580, 6439, 796, 5, 540, 398, 2922, 6, 861, 4308, 541, 5, 28, 1058, 471, 406, 6, 79, 14, 10, 144, 835, 28]
['感觉', '还', '蛮', '好', '的', ',', '用', '着', '反应', '也', '还', '蛮', '快', '的', '。', '还是', '以为', '黑', '蓝色',
'会', '很丑', ',', '准备', '买', '电脑', '贴', ',', '不过', '也', '还好', '。', '送', '的', '东西', '也', '蛮', '齐全', '的
', ',', '有', '的', '就是', '味道', '大', '了', '点', ',', '质量', '还', '行', ',', '有', '一点', '不好', '的', '就是', '
电脑', '鼠标', '那缝', '有点', '大', ',', '还是', '还', '可以', '接受']
[188, 90, 36, 135, 5, 6, 26, 95, 232, 14, 90, 36, 48, 5, 28, 110, 1917, 5636, 175, 67, 1739, 6, 1531, 133, 39, 1053, 6, 861,
14, 2348, 28, 498, 5, 922, 14, 36, 1432, 5, 6, 56, 5, 475, 5006, 229, 41, 381, 6, 654, 90, 2013, 6, 56, 485, 2922, 5, 475, 39, 1004, 6500, 516, 229, 6, 110, 90, 25, 701]
['天章', '出', '了', '很多', '种类', '的', '打印纸', ',', '品质', '一直', '都', '保持', '得', '挺', '好', '的', ',', '纸张', '洁白', '光滑', ',', '打印', '不', '卡纸', ',', '打印', '效果', '也', '很', '好', '很', '清晰', ',', '外包装', '也', '设
计', '的', '很', '好看', ',', '京东', '的', '配送', '也', '要', '表扬', '一下', ',', '上午', '落单', '下午', '就', '到', '
了', ',', '速度', '很赞', '!', '配送', '人员', '的', '服务态度', '也', '很', '好', '!']
[6613, 2689, 41, 1057, 1370, 5, 6614, 6, 1661, 330, 113, 1450, 773, 428, 135, 5, 6, 3438, 6615, 5460, 6, 467, 75, 6616, 6, 467, 398, 14, 10, 135, 10, 1250, 6, 2873, 14, 624, 5, 10, 429, 6, 756, 5, 2581, 14, 310, 257, 469, 6, 1417, 6617, 1281, 60, 134, 41, 6, 13, 932, 137, 2581, 501, 5, 89, 14, 10, 135, 137]
['货已', '收到', ',', '速度', '特别', '快', '!', '好使', ',', '比', '在', '专卖', '的', '要', '好', '很多', ',', '卖家',
'很', '贴心', '桌面上', '有', '一键', '还原', ',', ',', '外观', '美观大方', '还', '特别', '时尚', ',', '快递', '更是', '没
', '的', '说', ',', ',', '服务', '特别', '好', ',', '包装箱', '特别', '用心', '用', '的', '双层', '纸箱', '。', '卖家', '
很', '用心', ',', '买家', '更', '放心', '。', '期待', '着', '再次', '光临', '买', '着', '舒心']
[5526, 758, 6, 13, 767, 48, 137, 2521, 6, 308, 131, 7567, 5, 310, 135, 1057, 6, 83, 10, 1307, 7568, 56, 4428, 4223, 6, 6, 9,
7569, 90, 767, 1914, 6, 79, 203, 20, 5, 866, 6, 6, 141, 767, 135, 6, 7570, 767, 2599, 26, 5, 7571, 1419, 28, 83, 10, 2599, 6, 1303, 70, 1600, 28, 916, 95, 499, 7572, 133, 95, 4463]
- coding = 'c'
基本方法与上面一条完全相同,只是按照每个字符进行对应
帮家里老人选购的,对主机外观很满意,开机速度也不错,运行声音很小,暂时没发现什么问题,希望可以用的住。
enter the coding:c
['帮', '家', '里', '老', '人', '选', '购', '的', ',', '对', '主', '机', '外', '观', '很', '满', '意', ',', '开', '机', '速', '度', '也', '不', '错', ',', '运', '行', '声', '音', '很', '小', ',', '暂', '时', '没', '发', '现', '什', '么', '问', '题
', ',', '希', '望', '可', '以', '用', '的', '住', '。', '\n']
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 9, 18, 12, 19, 20, 21, 22, 23, 9, 24, 25, 26, 27, 15, 28, 9, 29,
30, 31, 32, 33, 34, 35, 36, 37, 9, 38, 39, 40, 41, 42, 8, 43, 44, 45]
seq_len = 105
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 9, 18, 12, 19, 20, 21, 22, 23, 9, 24, 25, 26, 27, 15, 28, 9, 29,
30, 31, 32, 33, 34, 35, 36, 37, 9, 38, 39, 40, 41, 42, 8, 43, 44, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
帮家里老人选购的,对主机外观很满意,开机速度也不错,运行声音很小,暂时没发现什么问题,希望可以用的住。
PADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPADPAD
记得第一台电脑的CPU是AMD K7 毒龙1G,后来用过AMD的CPU无数,作为一个A粉,多年后终于又有值得入手的U了,果断出手。京东价格好、送
货快,已装机点亮,就等送的E卡了……
[178, 113, 248, 175, 658, 56, 57, 8, 82, 342, 221, 103, 425, 80, 359, 210, 659, 66, 210, 693, 694, 231, 217, 9, 55, 139, 42,
532, 425, 80, 359, 8, 82, 342, 221, 423, 351, 9, 695, 662, 175, 50, 425, 149, 9, 114, 628, 55, 269, 235, 404, 87, 143, 113, 325, 135, 8, 221, 60, 9, 433, 696, 171, 135, 44, 674, 675, 100, 110, 183, 204, 119, 120, 72, 9, 697, 53, 12, 374, 698, 9, 93,
437, 119, 8, 699, 63, 60, 545, 681, 344, 456, 456, 298, 299, 547, 545, 681, 344, 456, 456, 298, 299, 547, 45]
京东服务。肯定没得说了。服务售后太强大了。并且联系了几次客服客服态度都是很好的。游匣7559戴尔性价比最高的游戏本,确实不错。只
是感觉掀起来屏幕时候屏幕发白可能是A板刚性问题。电脑还是很不错的。售后态度很好的
[674, 675, 126, 127, 44, 1103, 222, 31, 113, 97, 60, 44, 126, 127, 926, 55, 184, 390, 73, 60, 44, 1126, 201, 701, 361, 60, 821, 249, 190, 126, 190, 126, 128, 20, 155, 103, 15, 183, 8, 44, 76, 1379, 66, 244, 244, 372, 680, 285, 46, 100, 101, 290, 144, 8, 76, 77, 176, 9, 747, 392, 22, 23, 44, 380, 103, 238, 239, 1380, 310, 139, 301, 302, 30, 537, 301, 302, 32, 147, 40, 47, 103, 425, 321, 154, 46, 36, 37, 44, 56, 57, 129, 103, 15, 22, 23, 8, 44, 926, 55, 128, 20, 15, 183, 8, 45]
第一时间收货了,包裹到手第一感觉沉甸甸,主机拿出来还好。A面金属质感强烈,B面平淡无奇,C面背光键盘狂拽炫酷,打字手感也还不错,
唯一有点不好的就是右上角四个键帽不平整,特别是END,后续游戏及使用感受会追加!
[248, 175, 30, 206, 677, 120, 60, 9, 179, 962, 91, 135, 248, 175, 238, 239, 1610, 1611, 1611, 9, 11, 12, 878, 171, 139, 129,
183, 44, 425, 208, 219, 220, 622, 238, 390, 1043, 9, 229, 208, 446, 1612, 423, 948, 9, 82, 208, 464, 465, 463, 203, 1483, 1613, 714, 789, 9, 99, 347, 135, 238, 21, 129, 22, 23, 9, 438, 175, 87, 374, 22, 183, 8, 93, 103, 69, 54, 809, 842, 50, 463, 1271, 22, 446, 123, 9, 381, 416, 103, 699, 406, 359, 9, 55, 768, 76, 77, 858, 451, 42, 238, 648, 102, 140, 241, 186, 45]
笔记本好看,炫酷时尚,而且性能也不错,算是第一部自己挑的笔记本,华硕的机性价比还是可以的,口碑很好。真的7秒开机,甚至6秒好厉
害。用了两个礼拜,没什么问题,我主要是使用办公软件听听音乐看看视频,也没什么问题。
[177, 178, 176, 183, 90, 9, 714, 789, 30, 1127, 9, 200, 201, 46, 47, 21, 22, 23, 9, 335, 103, 248, 175, 598, 483, 484, 938, 8, 177, 178, 176, 9, 541, 542, 8, 12, 46, 100, 101, 129, 103, 40, 41, 8, 9, 716, 940, 15, 183, 44, 252, 8, 66, 67, 18, 12, 9,
1338, 964, 334, 67, 183, 1233, 1000, 44, 42, 60, 218, 50, 486, 1751, 9, 31, 34, 35, 36, 37, 9, 262, 11, 278, 103, 451, 42, 162, 574, 923, 378, 96, 96, 27, 763, 90, 90, 304, 305, 9, 21, 31, 34, 35, 36, 37, 44, 45]
今天拿到本子 第一感觉就是外观炫酷 加上灯光很是赚眼球 只是不知道灯光能不能自动变化 跑分成绩18w左右 然后测试了下dota2全特效 100帧左右 团战75帧左右 还是很不错 而且目前来看本子不热 值得入手
[535, 405, 878, 91, 176, 161, 210, 248, 175, 238, 239, 93, 103, 13, 14, 714, 789, 210, 241, 54, 599, 465, 15, 103, 1520, 394, 1462, 210, 380, 103, 22, 111, 112, 599, 465, 47, 22, 47, 483, 488, 591, 1301, 210, 242, 243, 495, 1754, 231, 357, 550, 68, 69, 210, 634, 55, 706, 233, 60, 379, 460, 226, 935, 660, 194, 246, 381, 382, 210, 231, 237, 237, 1113, 68, 69, 210, 1158, 1090, 66, 244, 1113, 68, 69, 210, 129, 103, 15, 22, 23, 210, 200, 201, 818, 256, 139, 90, 176, 161, 22, 316, 210, 143, 113, 325,
135, 45]
鼠标超出了我的预期,太好看了!左右键按着就好似没按一样,阻力特别小,但反应却极其的灵敏。玩LOL跑位补刀手感提高了很多,滚轮上有
防滑粒,橘黄色的灯光很诱人。鼠标好似一条金环蛇,静静的呆在鼠标垫儿上,蓄势待发!
[788, 353, 363, 171, 60, 262, 8, 841, 473, 9, 184, 183, 90, 60, 186, 68, 69, 463, 976, 134, 93, 183, 1402, 31, 976, 175, 156, 9, 994, 384, 381, 416, 28, 9, 151, 282, 283, 605, 581, 136, 8, 408, 1335, 44, 286, 81, 216, 81, 242, 182, 1106, 868, 135, 238, 780, 144, 60, 15, 114, 9, 1517, 909, 54, 87, 684, 685, 84, 9, 1906, 738, 148, 8, 599, 465, 15, 1405, 5, 44, 788, 353, 183, 1402, 175, 377, 219, 476, 979, 9, 626, 626, 8, 1477, 65, 788, 353, 816, 904, 54, 9, 1749, 953, 743, 32, 186, 45]
只有充电宝大小,很方便携带和固定,我在墙上固定一个盒子,装上去看我的海贼王。一百寸的效果,爽的不行不行。手机视频播放软件可以
直接投影,就是白天光线强的时候效果不好,不过属于正常的。总之五星好评,快递也很给力。
[380, 87, 1384, 56, 721, 73, 28, 9, 15, 168, 169, 775, 170, 281, 539, 222, 9, 262, 65, 562, 54, 539, 222, 175, 50, 643, 161,
9, 53, 54, 401, 90, 262, 8, 607, 1040, 1695, 44, 175, 440, 167, 8, 382, 433, 9, 308, 8, 22, 25, 22, 25, 44, 135, 12, 304, 305, 1156, 267, 923, 378, 40, 41, 393, 450, 561, 164, 9, 93, 103, 147, 405, 465, 274, 390, 8, 30, 537, 382, 433, 22, 183, 9, 22, 532, 220, 235, 131, 71, 8, 44, 455, 255, 490, 479, 183, 141, 9, 72, 117, 21, 15, 191, 384, 44, 45]
之前买了三星t5,体积很小,可是我的电脑没有火线接口,所以体现不出它的速度,只好退了换成这个1t的硬盘,速度很满意,做工很好,精
致,钱没白花,买来做移动硬盘,拷数据很快,价格也是合适,等不到最~就入手了,呵呵
[255, 256, 109, 60, 504, 479, 935, 244, 9, 124, 988, 15, 28, 9, 40, 103, 262, 8, 56, 57, 31, 87, 383, 274, 450, 716, 9, 107,
41, 124, 33, 22, 171, 752, 8, 19, 20, 9, 380, 183, 740, 60, 720, 495, 49, 50, 231, 935, 8, 395, 203, 9, 19, 20, 15, 16, 17, 9, 360, 163, 15, 183, 9, 180, 181, 9, 264, 31, 147, 667, 9, 109, 139, 360, 910, 488, 395, 203, 9, 1556, 351, 859, 15, 72, 9, 100, 110, 21, 103, 158, 157, 9, 437, 22, 91, 290, 728, 93, 325, 135, 60, 9, 1599, 1599, 45]
分析句子长度
import jieba
import matplotlib.pyplot as plt
x = []
y = []
with open('jd_comments.txt',encoding='utf-8') as f:
for line in f.readlines():
x.append(len(line))
y.append(len(jieba.lcut(line)))
#print(len(line),end = ' ')
plt.subplot(211)
plt.boxplot(x)
plt.title('sentence length')
plt.subplot(212)
plt.boxplot(y)
plt.title('the sentence length after jieba')
plt.savefig('test1.png')
plt.show()
plt.subplot(121)
plt.hist(x,bins=25)
plt.title('frequency of sentence length')
plt.subplot(122)
plt.hist(y,bins=25,color='orange')
plt.title('frequency of sentence length after jieba')
plt.savefig('test.png')
plt.show()
通过绘制箱型图和直方图可以发现评论的句子长度和正态分布的差距较大,具体表现在长度过短的评论几乎没有,有较多长度很长的评论。
如果选择平均值作为seq_len,效果可能没有那么好,不妨试一下中位数。或者利用箱型图处理一下异常点,之后再计算平均值可能更合理一些。
网友评论