{"id":13422673,"url":"https://github.com/tokestermw/tensorflow-shakespeare","last_synced_at":"2025-04-09T23:17:19.093Z","repository":{"id":73412541,"uuid":"46326434","full_name":"tokestermw/tensorflow-shakespeare","owner":"tokestermw","description":"Neural machine translation between the writings of Shakespeare and modern English using TensorFlow","archived":false,"fork":false,"pushed_at":"2022-12-11T00:42:28.000Z","size":5290,"stargazers_count":249,"open_issues_count":4,"forks_count":58,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-04-09T23:17:02.350Z","etag":null,"topics":["neural-machine-translation","seq2seq","shakespeare","tensorflow"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tokestermw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-11-17T05:58:21.000Z","updated_at":"2024-10-29T15:24:29.000Z","dependencies_parsed_at":"2023-02-28T00:16:31.964Z","dependency_job_id":null,"html_url":"https://github.com/tokestermw/tensorflow-shakespeare","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokestermw%2Ftensorflow-shakespeare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokestermw%2Ftensorflow-shakespeare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokestermw%2Ftensorflow-shakespeare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokestermw%2Ftensorflow-shakespeare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tokestermw","download_url":"https://codeload.github.com/tokestermw/tensorflow-shakespeare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125593,"owners_count":21051771,"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":["neural-machine-translation","seq2seq","shakespeare","tensorflow"],"created_at":"2024-07-30T23:00:50.266Z","updated_at":"2025-04-09T23:17:19.065Z","avatar_url":"https://github.com/tokestermw.png","language":"Python","funding_links":[],"categories":["Models/Projects","Cool Projects","模型项目"],"sub_categories":["微信群"],"readme":"# Shakespeare translations using TensorFlow\n\nThis is an example of using the new Google's [TensorFlow](https://github.com/tensorflow/tensorflow) library on\nmonolingual translation going from modern English to Shakespeare based on research from \n[Wei Xu](https://github.com/cocoxu/Shakespeare).\n\n## Prepare\n\nFirst download the TensorFlow library depending on your platform:\n\n```\npip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl # for mac\npip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl # for ubuntu\n```\n\n1. Grabs parallel data.\n2. Gets train, dev split.\n3. Builds vocabulary\n4. Converts parallel data into ids\n\nFrom the root directory:\n\n```\npython -m tensorshake.get_data\npython -m tensorshake.prepare_corpus\n```\n\nDelete /cache to start anew.\n\n## Train\n\nUse the example BASH script to train the model. This saves the check points in the `--train_dir` directory.\nIf you run it again, the training process continues from the check point. To restart with fresh parameters,\nsimply delete/rename the check points.\n\n```\n./run.sh\n```\n\n## Results\n\n[Benchmarks from original paper.](http://aclweb.org/anthology/C/C12/C12-1177.pdf) (Shakespeare -\u003e Modern English)\n\nInput | Output\n --- | ---\ni will bite thee by the ear for that jest . | i ’ ll bite you by the ear for that joke .\nwhat further woe conspires against mine age ? | what ’ s true despair conspires against my old age ?\nhow doth my lady ? |how is my lady ?\nhast thou slain tybalt ? |have you killed tybalt ?\nan i might live to see thee married once , i have my wish .| if i could live to see you married, i ’ ve my wish .\nbenvolio , who began this bloody fray ? | benvolio , who started this bloody fight itself ?\nwhat is your will ? | what do you want ? \ncall her forth to me . |bring her out to me .\n\n*Cherrypicked examples from this repo* (Modern English -\u003e Shakespeare)\n\n| Input | Output \n----- | ---\nbut you’re not listening to me. | but you do not hear me .\nGregory, on my word, we will not be humiliated, like carrying coal. | regory , we 'll not carry coals .\nbut he got the promotion.  | he is the friend .\ni can hit quickly, if i'm motivated. | i strike , i am moved .\nDid you just give us the finger, sir? | have you leave the thumb , sir ?\nYou don’t know what you’re doing! | you do not what you know you .\nhave you killed Tybalt? | hast thou slain tybalt ?\nWhy, Romeo, are you crazy? | why , art thou mad , mad ?\n\n## Pre-Trained Models\n\nHere is a link for an example model: https://s3-us-west-2.amazonaws.com/foxtype-nlp/tensorshake/model_cache.zip\n\n## Possible improvements\n\n- word embeddings\n- beam search\n- language model reranking\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokestermw%2Ftensorflow-shakespeare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftokestermw%2Ftensorflow-shakespeare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokestermw%2Ftensorflow-shakespeare/lists"}