{"id":20284577,"url":"https://github.com/bvsam/ml-translation","last_synced_at":"2026-04-29T21:37:09.261Z","repository":{"id":210706048,"uuid":"727243714","full_name":"bvsam/ml-translation","owner":"bvsam","description":"Sequence to sequence models for language translation.","archived":false,"fork":false,"pushed_at":"2023-12-05T01:15:23.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-03T03:42:03.430Z","etag":null,"topics":["deep-learning","machine-learning","python","pytorch","rnn","translation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bvsam.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-04T13:30:19.000Z","updated_at":"2023-12-04T13:54:50.000Z","dependencies_parsed_at":"2023-12-04T15:09:53.269Z","dependency_job_id":null,"html_url":"https://github.com/bvsam/ml-translation","commit_stats":null,"previous_names":["bvsam/ml-translation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bvsam/ml-translation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bvsam%2Fml-translation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bvsam%2Fml-translation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bvsam%2Fml-translation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bvsam%2Fml-translation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bvsam","download_url":"https://codeload.github.com/bvsam/ml-translation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bvsam%2Fml-translation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32445543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["deep-learning","machine-learning","python","pytorch","rnn","translation"],"created_at":"2024-11-14T14:20:22.286Z","updated_at":"2026-04-29T21:37:09.236Z","avatar_url":"https://github.com/bvsam.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ML Translation\n\n## About\n\n- Sequence to sequence models (seq2seq) for language translation with Pytorch\n  - bidirectional encoder-decoder LSTM\n    - notebook at `src/en-fr_rnn.ipynb`\n- English to French translation using the Anki dataset\n- Model deployment on AWS Sagemaker for inference using [bentoml](https://www.bentoml.com/)\n\n## Deployment\n\nSteps to deploy the trained model on AWS Sagemaker for inference. The final result will include the model being accessible for inference at a specific API endpoint on AWS.\n\n### Prerequisites:\n\n- Install Terraform\n- Install Docker\n\n### Steps\n\n1. Install `requirements.txt`\n\n```\npip install -r requirements.txt\n```\n\n2. Run the `src/en-fr_rnn.ipynb` notebook to train the model and save its weights at `src/weights/en-fr_rnn_lstm_512.pt`. Modify `src/create_model.py` with any changes to the final model's architecture or the paths to its weights, if necessary.\n\n   Note: pretrained weights are currently not included in this repo due to file size limits imposed by Github\n\n3. Create the bentoml model\n\n```\ncd src\npy create_model.py\n```\n\n3. Build the bento\n\n```\nbentoml build\n```\n\n4. Install the aws-sagemaker bentoctl operator\n\n```\nbentoctl operator install aws-sagemaker\n```\n\n5. Initialize a bentoctl deployment. You may want to delete files including `src/deployment_config.yaml` and `src/main.tf` before doing so (so that they can be overwritten without any conflict).\n\n   Note: If other operators are installed, running `bentoctl init` may not work as expected, specifically for Windows hosts. Remove all existing bentoctl operators by deleting the bentoctl folder at `~/bentoctl`. Then install the operator you'd like to work with.\n\n```\nbentoctl init\n```\n\n6. Run `bentoctl build` with the deployment config and the built bento. You can view existing bentos with the command `bentoml list`.\n\n```\nbentoctl build -f deployment_config.yaml -b \u003cYOUR_BENTO_NAME:TAG_HERE\u003e\n```\n\n7. Initialize Terraform and apply the terraform config/plan. Use `bentoctl.tfvars`, which should have been created when running `bentoctl init`, for the var. file.\n\n```\nterraform init\nterraform apply --var-file=bentoctl.tfvars\n```\n\n### Teardown\n\nOnce done, destroy all resources created (including the AWS ecr repository) with:\n\n```\nbentoctl destroy\n```\n\n## TODO (Improvements)\n\n- Implement attention with the RNNs, or even a transformer\n- Try using a larger dataset, such as WMT 2014\n- Test and implement different methods to reduce text degeneration\n\n## References\n\n- Pytorch tutorial by [Sean Robertson](https://github.com/spro) introducing seq2seq networks: https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html\n- Youtube video by [@mildlyoverfitted](https://www.youtube.com/@mildlyoverfitted) explaining the bentoml deployment process: https://youtu.be/Zci_D4az9FU\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbvsam%2Fml-translation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbvsam%2Fml-translation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbvsam%2Fml-translation/lists"}