Skip to main content

seq2seq

Industrial-grade implementation of seq2seq algorithm based on Pytorch, integrated beam search algorithm.

seq2seq is based on other excellent open source projects, this project has the following highlights:

  1. easy to train, predict and deploy;
  2. lightweight implementation;
  3. multitasking support (including dialogue generation and machine translation).

Model description

Install

seq2seq is dependent on PyTorch. Two ways to install:

Install seq2seq from Pypi:

pip install seq2seq-pytorch

Install seq2seq from the Github source:

git clone https://github.com/Chiang97912/seq2seq.git
cd seq2seq
python setup.py install

Usage

Train

from seq2seq.model import Seq2Seq

sources = ['...']
targets = ['...']
model = Seq2Seq('seq2seq-model', embed_size=256, hidden_size=512, lang4src='en', lang4tgt='en', device='cuda:0')
model.fit(sources, targets, epochs=20, batch_size=64)

Test

from seq2seq.model import Seq2Seq

model = Seq2Seq('seq2seq-model')
outputs = model.generate('...', beam_size=3, method='greedy')
print(outputs)

Dependencies

  • python version 3.6
  • pyTorch version 1.9.0
  • torchtext version 0.3.1
  • numpy version 1.19.5
  • nltk version 3.5
  • jieba version 0.42.1

References

Metadata

Release files for seq2seq-pytorch 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seq2seq-pytorch 0.1.2
File Size Uploaded
seq2seq-pytorch-0.1.2.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for seq2seq-pytorch 0.1.2
File Interpreter ABI Platform
seq2seq_pytorch-0.1.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 19.7 kB

Release files / seq2seq-pytorch-0.1.2.tar.gz

Download URL seq2seq-pytorch-0.1.2.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
28d6a868f3b85be47cb1a069c3efccfcb33d41d15f8b52e12e40e5eb3e839675
BLAKE2b-256 checksum
How to use checksums
e00791858d769a76b048505d5fb64e123148d5a1ba59eb42e0201b81e1c8d07a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

Release files / seq2seq_pytorch-0.1.2-py2.py3-none-any.whl

Download URL seq2seq_pytorch-0.1.2-py2.py3-none-any.whl
Size 10.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
82df2014028960e6dad306103f6e8f70dc71e0d88892c9427ef358b2fb549d7f
BLAKE2b-256 checksum
How to use checksums
7cf912a41d3dc7da8729249f5d843928e3d9e419d92ae86ce8f61ddf1fcec016
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.6.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page