Skip to main content

CopyNet with TensorFlow 2.0

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

copynet-tf-0.2.0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

copynet_tf-0.2.0-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file copynet-tf-0.2.0.tar.gz.

File metadata

  • Download URL: copynet-tf-0.2.0.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for copynet-tf-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d4316f412c45375fe30cc533264d3321632280dac31a546f0ce8a361aa37598b
MD5 d7415cb0bd42d3aecafb340b2cd3be2f
BLAKE2b-256 7d215942b8045a8c4c31d3f333283fcbffd45995dd61a61d86e77b33b88d0007

See more details on using hashes here.

File details

Details for the file copynet_tf-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: copynet_tf-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 25.4 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for copynet_tf-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2992ceb84048f7a5f8e105f37afead20cf89ec4cbdc25525e7692f1925aa693
MD5 411060b1138c9dfe95300b783676c087
BLAKE2b-256 8dd316f3a2df1445f98c077b5051cabf085a7a17ac49f51c523b839f3a246a45

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page