2021-02-02

1 - Sequence to Sequence Learning with Neural Networks

In this series we'll be building a machine learning model to go from once sequence to another, using PyTorch and TorchText. This will be done on German to English translations, but the models can be applied to any problem that involves going from one sequence to another, such as summarization, i.e. going from a sequence to a shorter sequence in the same language.

在這一系列,我們將使用Pytorch和TorchText來構(gòu)建序列機(jī)器學(xué)習(xí)模型。這將完成德語和英語的翻譯,模型可以應(yīng)用于涉及從一個序列到另一個序列的任何問題,例如摘要,即從同一語言的序列到較短的序列。

In this first notebook, we'll start simple to understand the general concepts by implementing the model from the Sequence to Sequence Learning with Neural Networks paper.

Introduction

The most common sequence-to-sequence (seq2seq) models are encoder-decoder models, which commonly use a recurrent neural network (RNN) to encode the source (input) sentence into a single vector. In this notebook, we'll refer to this single vector as a context vector. We can think of the context vector as being an abstract representation of the entire input sentence. This vector is then decoded by a second RNN which learns to output the target (output) sentence by generating it one word at a time.

最常見的序列對序列的模型即編碼解碼模型,通常使用遞歸神經(jīng)網(wǎng)絡(luò)(RNN)將源(輸入)語句編碼為單個向量。我們將這個向量稱為上下文向量。我們可以將上下文向量視為整個輸入句子的抽象表示。 然后,該向量由第二個RNN解碼,該第二個RNN通過一次生成一個單詞來學(xué)習(xí)輸出目標(biāo)(輸出)語句。

image.png
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容