点此进入CSDN

点此添加QQ好友 加载失败时会显示




上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 23 下一页
摘要: 阅读全文
posted @ 2020-02-29 21:57 高颜值的殺生丸 阅读(434) 评论(0) 推荐(0) 编辑
摘要: """ 构造召回的模型 """ from sklearn.feature_extraction.text import TfidfVectorizer import pysparnn.cluster_index as ci from cut_sentence import cut import js 阅读全文
posted @ 2020-02-29 21:38 高颜值的殺生丸 阅读(327) 评论(0) 推荐(0) 编辑
摘要: import pysparnn.cluster_index as ci from sklearn.feature_extraction.text import TfidfVectorizer data = [ "hello world", "oh hello there", "Play it", " 阅读全文
posted @ 2020-02-29 21:16 高颜值的殺生丸 阅读(486) 评论(0) 推荐(0) 编辑
摘要: decoder.py """ 实现解码器 """ import heapq import torch.nn as nn import config import torch import torch.nn.functional as F import numpy as np import rando 阅读全文
posted @ 2020-02-29 21:15 高颜值的殺生丸 阅读(911) 评论(0) 推荐(0) 编辑
摘要: attention.py """ 实现attention """ import torch import torch.nn as nn import torch.nn.functional as F import config class Attention(nn.Module): def __in 阅读全文
posted @ 2020-02-28 21:36 高颜值的殺生丸 阅读(562) 评论(0) 推荐(0) 编辑
摘要: import heapq my_heap = [] #使用列表保存数据 #网列表中插入数据,优先级使用插入的内容来表示,就是一个比较大小的操作,越大优先级越高 heapq.heappush(my_heap,[29,True,"xiaohong","asdfa"]) heapq.heappush(my 阅读全文
posted @ 2020-02-28 20:44 高颜值的殺生丸 阅读(307) 评论(0) 推荐(0) 编辑
摘要: cut_sentence.py """ 实现句子的分词 注意点: 1. 实现单个字分词 2. 实现按照词语分词 2.1 加载词典 3. 使用停用词 """ import string import jieba import jieba.posseg as psg import logging sto 阅读全文
posted @ 2020-02-28 16:17 高颜值的殺生丸 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 增加一个维度 out.unsqueeze(-1) 降低一个维度 out.squeeze(dim=1) 阅读全文
posted @ 2020-02-23 11:32 高颜值的殺生丸 阅读(1331) 评论(0) 推荐(0) 编辑
摘要: 在循环内加的teacher forcing机制,这种为目标确定的时候,可以这样加。 目标不确定,需要在循环外加。 decoder.py 中的修改 """ 实现解码器 """ import torch.nn as nn import config import torch import torch.n 阅读全文
posted @ 2020-02-22 00:11 高颜值的殺生丸 阅读(1320) 评论(0) 推荐(1) 编辑
摘要: num_sequence.py """ 数字序列化方法 """ class NumSequence: """ input : intintint output :[int,int,int] """ PAD_TAG = "<PAD>" UNK_TAG = "<UNK>" SOS_TAG = "<SOS 阅读全文
posted @ 2020-02-20 21:07 高颜值的殺生丸 阅读(776) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 23 下一页

作者信息

昵称:

刘新宇

园龄:4年6个月


粉丝:1209


QQ:522414928