Giter Site home page Giter Site logo

pervin0527 / pytorch-seq2seq-beam-search Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 312shan/pytorch-seq2seq-beam-search

0.0 0.0 0.0 22.8 MB

PyTorch implementation for Seq2Seq model with attention and Greedy Search / Beam Search for neural machine translation

License: MIT License

Python 82.79% Jupyter Notebook 17.21%

pytorch-seq2seq-beam-search's Introduction

Pytorch-seq2seq-Beam-Search

Seq2Seq model with attention and Greedy Search / Beam Search for neural machine translation in PyTorch.

This implementation focuses on the following features:

  • Modular structure to be used in other projects
  • Minimal code for readability
  • Full utilization of batches and GPU.
  • Decoding Method Greedy Search
  • Decoding Method Beam Search

This implementation relies on torchtext to minimize dataset management and preprocessing parts.

Seq2Seq Model description

The main structure of seq2seq is adopt in seq2seq

  • Encoder: Bidirectional GRU
  • Decoder: GRU with Attention Mechanism
  • Attention

Decoding Method

  • Greedy Search
  • Beam Search

Requirements

  • CUDA
  • Python 3.6
  • PyTorch 1.4
  • torchtext
  • Spacy
  • numpy
  • Visdom (optional)

download tokenizers by doing so:

python -m spacy download de
python -m spacy download en

TODO

  1. add logging
  2. change to support gpu and cpu, currently is gpu based code implementation
  3. Do Length normalization experiment on Beam-Search And Compare

References

Based on the following implementations

pytorch-seq2seq-beam-search's People

Contributors

keon avatar pskrunner14 avatar 312shan avatar pervin0527 avatar linao1996 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.