{"id":14959137,"url":"https://github.com/pavanchhatpar/copynet-tf","last_synced_at":"2025-10-24T16:31:11.207Z","repository":{"id":39739245,"uuid":"260197969","full_name":"pavanchhatpar/copynet-tf","owner":"pavanchhatpar","description":"CopyNet (Copy Mechanism in Seq2Seq) implementation with TensorFlow 2","archived":false,"fork":false,"pushed_at":"2022-11-21T21:18:49.000Z","size":108,"stargazers_count":10,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T03:12:17.236Z","etag":null,"topics":["copy-mechanism","copynet","seq2seq","tensorflow-tutorial","tensorflow2","tf-keras"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pavanchhatpar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-30T11:52:18.000Z","updated_at":"2023-03-23T05:13:59.000Z","dependencies_parsed_at":"2023-01-22T19:15:27.268Z","dependency_job_id":null,"html_url":"https://github.com/pavanchhatpar/copynet-tf","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavanchhatpar%2Fcopynet-tf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavanchhatpar%2Fcopynet-tf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavanchhatpar%2Fcopynet-tf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavanchhatpar%2Fcopynet-tf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pavanchhatpar","download_url":"https://codeload.github.com/pavanchhatpar/copynet-tf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237999677,"owners_count":19399920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["copy-mechanism","copynet","seq2seq","tensorflow-tutorial","tensorflow2","tf-keras"],"created_at":"2024-09-24T13:18:54.584Z","updated_at":"2025-10-24T16:31:10.633Z","avatar_url":"https://github.com/pavanchhatpar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CopyNet implementation with TensorFlow 2\n - Incorporating Copying Mechanism in Sequence-to-Sequence Learning\n - Uses `TensorFlow 2.0` and above APIs with `tf.keras` too\n - Adapted from AllenNLP's PyTorch implementation, their blog referenced \n below was very helpful to understand the math from an implementation\n perspective\n\n![Python package](https://github.com/pavanchhatpar/copynet-tf/workflows/Python%20package/badge.svg)\n![Upload Python Package](https://github.com/pavanchhatpar/copynet-tf/workflows/Upload%20Python%20Package/badge.svg)\n\n## Install package\n### Using pip\n```bash\npip install copynet-tf\n```\n\n### Compile from source\n```bash\npython -m pip install --upgrade pip\npip install setuptools wheel\npython setup.py sdist bdist_wheel\n```\n\n## Examples\n### Abstract usage\n```python\n...\nimport MyEncoder\nfrom copynet_tf import GRUDecoder\n\n...\n\nclass MyModel(tf.keras.Model):\n\n  ...\n\n  def call(self, X, y, training):\n    source_token_ids, source2target_ids = X\n    target_token_ids, target2source_ids = y\n\n    enc_output, enc_final_output, mask = self.encoder(X, y, training)\n    output_dict = self.decoder(\n      source_token_ids, source2target_ids, mask,\n      target_token_ids, target2source_ids, training)\n    return output_dict\n\n  ...\n\n```\n\n### Concrete examples\nFind concrete examples inside [examples](./examples) folder of the repo\n\n## References\n - Incorporating Copying Mechanism in Sequence-to-Sequence Learning: ([paper](https://arxiv.org/abs/1603.06393))\n - AllenNLP implementation: ([blog](https://medium.com/@epwalsh10/incorporating-a-copy-mechanism-into-sequence-to-sequence-models-40917280b89d)) ([code](https://github.com/epwalsh/nlp-models))\n - BLEU score metric: ([code](https://github.com/tensorflow/nmt/blob/master/nmt/scripts/bleu.py))","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavanchhatpar%2Fcopynet-tf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpavanchhatpar%2Fcopynet-tf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavanchhatpar%2Fcopynet-tf/lists"}