{"id":17705724,"url":"https://github.com/rahul1582/machine-translation","last_synced_at":"2025-10-15T15:15:18.676Z","repository":{"id":112414323,"uuid":"191802753","full_name":"Rahul1582/Machine-Translation","owner":"Rahul1582","description":"Translating one language to another","archived":false,"fork":false,"pushed_at":"2020-10-07T15:32:40.000Z","size":1603,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-31T05:16:59.881Z","etag":null,"topics":["attention-mechanism","data-mining","encoder-decoder-model","gru","lstm"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/Rahul1582.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-13T17:05:08.000Z","updated_at":"2023-10-04T18:59:24.000Z","dependencies_parsed_at":"2023-06-25T22:24:37.540Z","dependency_job_id":null,"html_url":"https://github.com/Rahul1582/Machine-Translation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rahul1582/Machine-Translation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahul1582%2FMachine-Translation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahul1582%2FMachine-Translation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahul1582%2FMachine-Translation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahul1582%2FMachine-Translation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rahul1582","download_url":"https://codeload.github.com/Rahul1582/Machine-Translation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rahul1582%2FMachine-Translation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260915848,"owners_count":23082035,"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":["attention-mechanism","data-mining","encoder-decoder-model","gru","lstm"],"created_at":"2024-10-24T22:41:51.406Z","updated_at":"2025-10-15T15:15:18.575Z","avatar_url":"https://github.com/Rahul1582.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Machine Translation\n\nTranslating a text from One Language To Another.\n\n\u003cbr\u003e\n\u003cimg src =\"images/image.jpg\"  width=800 height=500\u003e  \n\u003cbr\u003e\n\n## Methods Used\n\n1. Encoder - Decoder Architecture\n\n2. Attention Mechanism\n\n2. Training and Inference Mode of Decoder\n\n## Encoder-Decoder Architecture\n\n1. The encoder LSTM is used to process the entire input sentence and encode it into a context vector, which is the last hidden state of the LSTM/RNN. This is expected to be a good summary of the input sentence. All the intermediate states of the encoder are ignored, and the final state id supposed to be the initial hidden state of the decoder.\n\n2. The decoder LSTM or RNN units produce the words in a sentence one after another. The model is trained by Teacher Forcing technique and tested through the Inference mode.\n\n## Attention Mechanism\n\nIn psychology, attention is the cognitive process of selectively concentrating on one or a few things while ignoring others. The attention mechanism was born to help memorize long source sentences in neural machine translation (NMT). \n\nRather than building a single context vector out of the encoder's last hidden state, the secret sauce invented by attention is to create shortcuts between the context vector and the entire source input.\n\n## Bahdanau Attention\n\n1. Producing the Encoder Hidden States - Encoder produces hidden states of each element in the input sequence.\n\n2. Calculating Alignment Scores between the previous decoder hidden state and each of the encoder’s hidden states are calculated (Note: The last encoder hidden state can be used as the first hidden state in the decoder).\n\n3. Softmaxing the Alignment Scores - the alignment scores for each encoder hidden state are combined and represented in a single vector and subsequently softmaxed.\n\n4. Calculating the Context Vector - the encoder hidden states and their respective alignment scores are multiplied to form the context vector.\n\n5. Decoding the Output - the context vector is concatenated with the previous decoder output and fed into the Decoder RNN for that time step along with the previous decoder hidden state to produce a new output.\n\n6. The process (steps 2-5) repeats itself for each time step of the decoder until an token is produced or output is past the specified maximum length.\n\n\u003cbr\u003e\n\u003cimg src =\"images/image1.jpg\"  width=800 height=500\u003e  \n\u003cbr\u003e\n\n\n# Technologies Used\n```\n1. LSTM\n\n2. GRU\n\n3. Sequence To Sequence Model(Encoder-Decoder)\n\n4. Bahdanau Attention Mechanism\n\n```\n\n## Usage\n\nIt can be used as a translator where you will be getting the result in a new language.\n\n## Improvement\n\nWe can improve the model by improving the dataset. Training with more epochs with the improved dataset.\n\n### Author \n```\nRahul Kumar Patro\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahul1582%2Fmachine-translation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahul1582%2Fmachine-translation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahul1582%2Fmachine-translation/lists"}