Code Monkey home page Code Monkey logo

english_hindi_language_translation_pytorch's Introduction

English to Hindi Language Translation Pytorch Using Seq2Seq with Attention

Python3.9 Made withJupyter PyTorch Language Translation

Important Points to Consider

  • run the notebook entirely on google colab or run it on local system using checkpoint.pth file of google colab on windows causes issue while reading csv file windows misses some rows completly resulting more words in output(hindi) ie different vocab size in colab as compared to windows enviromnent and these vocab size are used as input in model to resolve this issue i created lang.pth so the checkpoint.pth can be used on windows machine open Test.ipynb to see how to use it i use it to demonstrate the translation but it may be used for traning also

  • You can use other csv files for traning i tried a comparitively very small size file but result was not good as we have very less data

  • you see imports again and again initially these are going to be two seperate files one for data prepration and another for traninga and testing buy finally i combine them both

  • You found that pairs serves no purpose here but you can also proceed traning with pairs i go with eng , hin , array

  • I only use 2000 top records for traning but while inililizing encoder i give lang.n_words which is the vocab size of input created from whole dataset this is due to i am proceding it with incremental traning (traning first 2000 record with 30 epochs and 2000 ...) due to limiting computing power if you have enoughh computing tweak the parameter accordingly this creates a checkpoint.pth file around 1.7GB combinig encoder , decoder , and their respective optimizers state dict download checkpoint.pth used in Test.ipynb

  • result in output of last cell in Test.ipynb is created by loading checkpoint.pth which is created by traning model for 30 epoch on first 2000 records and loss = 0.1 further traning will reduce it as we have lot of data

* Pleanse let me know if you create a better version of this code

english_hindi_language_translation_pytorch's People

Contributors

lakshit-karsoliya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.