Beam Search的问题 先解释一下什么要对Beam Search进行改进.因为Beam Search虽然比贪心强了不少,但还是会生成出空洞.重复.前后矛盾的文本.如果你有文本生成经验,一定对这些现象并不陌生.在语言模型还不像如今的BERT.GPT这么厉害的时候,这种现象更加明显. 没有经验也没关系,我们来看一个论文里面的例子.输入模型的引文(context) "The study, published in the Proceedings of the They were cattle c
Wiki定义:In computer science, beam search is a heuristic search algorithm that explores a graph by expanding the most promising node in a limited set. Beam search is an optimization of best-first search that reduces its memory requirements. Best-first
decoder.py """ 实现解码器 """ import heapq import torch.nn as nn import config import torch import torch.nn.functional as F import numpy as np import random from chatbot.attention import Attention class Decoder(nn.Module): def __i
1. 基础模型 A. Sequence to sequence model:机器翻译.语音识别.(1. Sutskever et. al., 2014. Sequence to sequence learning with neural networks. 2. Cho et. al., 2014. Learning phrase representations using RNN encoder-decoder for statistical machine translation.) B
绘制了一张导图,有不对的地方欢迎指正: 下载地址 机器学习中,特征是很关键的.其中包括,特征的提取和特征的选择.他们是降维的两种方法,但又有所不同: 特征抽取(Feature Extraction):Creatting a subset of new features by combinations of the exsiting features.也就是说,特征抽取后的新特征是原来特征的一个映射. 特征选择(Feature Selection):choosing a subset of all
一.概述 自动摘要可以从很多角度进行分类,例如单文档摘要/多文档摘要.单语言摘要/跨语言摘要等.从技术上说,普遍可以分为三类: i. 抽取式摘要(extractive),直接从原文中抽取一些句子组成摘要.本质上就是个排序问题,给每个句子打分,将高分句子摘出来,再做一些去冗余(方法是MMR)等.这种方式应用最广泛,因为比较简单,比如博客园的博客摘要就是前面几句话.经典方法有LexRank和整数线性规划(ILP). LexRank是将文档中的每个句子都看作节点,句子之间的相似度看作节点之间的边的权重