Skip to main content

CopyNet implementation with TensorFlow 2

  • Incorporating Copying Mechanism in Sequence-to-Sequence Learning
  • Uses TensorFlow 2.0 and above APIs with tf.keras too
  • Adapted from AllenNLP's PyTorch implementation, their blog referenced below was very helpful to understand the math from an implementation perspective

Python package Upload Python Package

Environment to run examples

Setup

  • Copy sample.env to .env and enter appropriate values for the variables
  • A brief description of each is provided as a comment in that file
  • Post that run,
    ./setup-env.sh [--no-docker]
    
  • Uses env file to configure project environment
  • Builds required docker images (if you don't wanna use Docker then pass --no-docker option to the setup-env.sh script)
  • Makes a python environment and installes required packages in it
  • Prepares an lock.env file. Do not edit/ delete it

Rebuilding environment

  • You may change environment config in the process of development
  • This includes adding a new python package to requirements.txt
  • After changing run,
    ./setup-env.sh [--no-docker]
    
  • If you do not want Docker, then pass --no-docker option similar to before

Start environment

  • At the end of setup script you will be shown the commands to start the environments
  • They are,
    ./start-env.sh nb    # For Dockerized jupyter server
    ./start-env.sh bash  # For Dockerized bash
    
  • It is not necessary to use the start-env.sh script for virtualenv, the regular source command to activate it is enough

Note on Dockerized environment

  • The dockerized environment is specifically helpful and recommended when using GPU
  • It takes care of many nuances involved in setting up CUDA. Your host machine should just have correct NVIDIA drivers and nothing else
  • It is recommended to run the examples in this environment to ensure all correct dependencies are met

Run examples

  • Instructions to run an example are detailed in its own folders respectively

References

  • Incorporating Copying Mechanism in Sequence-to-Sequence Learning: (paper)
  • AllenNLP implementation: (blog) (code)
  • BLEU score metric: (code)

Metadata

Release files for copynet-tf 0.2.0

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

Source distribution (sdist)

Source distribution for copynet-tf 0.2.0
File Size Uploaded
copynet-tf-0.2.0.tar.gz 21.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for copynet-tf 0.2.0
File Interpreter ABI Platform
copynet_tf-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 47.0 kB

Release files / copynet-tf-0.2.0.tar.gz

Download URL copynet-tf-0.2.0.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d4316f412c45375fe30cc533264d3321632280dac31a546f0ce8a361aa37598b
BLAKE2b-256 checksum
How to use checksums
7d215942b8045a8c4c31d3f333283fcbffd45995dd61a61d86e77b33b88d0007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release files / copynet_tf-0.2.0-py3-none-any.whl

Download URL copynet_tf-0.2.0-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2992ceb84048f7a5f8e105f37afead20cf89ec4cbdc25525e7692f1925aa693
BLAKE2b-256 checksum
How to use checksums
8dd316f3a2df1445f98c077b5051cabf085a7a17ac49f51c523b839f3a246a45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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