GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bentrevett/pytorch-seq2seq: Tutorials on implementing a few sequence-to-sequence (seq2seq) models with PyTorch and TorchText.

BranchesTags
Open more actions menu

Latest commit

 

History

175 Commits
175 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
legacy
legacy
 
 
.gitignore
.gitignore
 
 
1 - Sequence to Sequence Learning with Neural Networks.ipynb
1 - Sequence to Sequence Learning with Neural Networks.ipynb
 
 
2 - Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation.ipynb
2 - Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation.ipynb
 
 
3 - Neural Machine Translation by Jointly Learning to Align and Translate.ipynb
3 - Neural Machine Translation by Jointly Learning to Align and Translate.ipynb
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

PyTorch Seq2Seq

This repo contains tutorials covering understanding and implementing sequence-to-sequence (seq2seq) models using PyTorch, with Python 3.9. Specifically, we'll train models to translate from German to English.

If you find any mistakes or disagree with any of the explanations, please do not hesitate to submit an issue. I welcome any feedback, positive or negative!

Getting Started

Install the required dependencies with: pip install -r requirements.txt --upgrade.

We'll also make use of spaCy to tokenize our data which requires installing both the English and German models with:

python -m spacy download en_core_web_sm
python -m spacy download de_core_news_sm

Tutorials

  • 1 - Sequence to Sequence Learning with Neural Networks Open In Colab

    This first tutorial covers the workflow of a seq2seq project with PyTorch. We'll cover the basics of seq2seq networks using encoder-decoder models, how to implement these models in PyTorch, and how to use the datasets/spacy/torchtext/evaluate libraries to do all of the heavy lifting. The model itself will be based off an implementation of Sequence to Sequence Learning with Neural Networks, which uses multi-layer LSTMs.

  • 2 - Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation Open In Colab

    Now we have the basic workflow covered, this tutorial will focus on improving our results. Building on our knowledge of PyTorch, we'll implement a second model, which helps with the information compression problem faced by encoder-decoder models. This model will be based off an implementation of Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation, which uses GRUs.

  • 3 - Neural Machine Translation by Jointly Learning to Align and Translate Open In Colab

    Next, we learn about attention by implementing Neural Machine Translation by Jointly Learning to Align and Translate. This further allievates the information compression problem by allowing the decoder to "look back" at the input sentence by creating context vectors that are weighted sums of the encoder hidden states. The weights for this weighted sum are calculated via an attention mechanism, where the decoder learns to pay attention to the most relevant words in the input sentence.

Legacy Tutorials

Previous versions of these tutorials used features from the torchtext library which are no longer available. These are stored in the legacy directory.

References

Here are some things I looked at while making these tutorials. Some of it may be out of date.

  • https://github.com/spro/practical-pytorch
  • https://github.com/keon/seq2seq
  • https://github.com/pengshuang/CNN-Seq2Seq
  • https://github.com/pytorch/fairseq
  • https://github.com/jadore801120/attention-is-all-you-need-pytorch
  • http://nlp.seas.harvard.edu/2018/04/03/attention.html
  • https://www.analyticsvidhya.com/blog/2019/06/understanding-transformers-nlp-state-of-the-art-models/

About

Tutorials on implementing a few sequence-to-sequence (seq2seq) models with PyTorch and TorchText.

Topics

attentioncnn-seq2seqencoder-decoderencoder-decoder-modelgrulstmneural-machine-translationpytorchpytorch-implementationpytorch-implmentionpytorch-nlppytorch-seq2seqpytorch-tutorialpytorch-tutorialsrnnseq2seqsequence-to-sequencetorchtexttransformertutorial

Resources

Readme
MIT license
Activity

Stars

5.7k stars

Watchers

61 watching

Forks

1.4k forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.