Code Monkey home page Code Monkey logo

how_to_make_a_language_translator's Introduction

How_to_make_a_language_translator

This is the code for "How to Make a Language Translator - Intro to Deep Learning #11' by Siraj Raval on YouTube

Coding Challenge - Due Date Thursday March 30th at 12 PM PST

Make your own language translator using a deep learning architecture of your choice in Tensorflow. It doesn't have to use Neural Machine Translation specifically. Here are some example. This exercise will help you appreciate the full power of statistical translation techniques.

Overview

This is the code for this video on Youtube by Siraj Raval as part of the Deep Learning Nanodegree course with Udacity. This code implemnents Neural Machine Translation which is what Google Translate uses to translate Languages.

Dependencies

  • tensorflow
  • nltk
  • six

Install missing dependencies with pip

Usage

To train model on data and test it to compute the BLEU score run this:

python translate.py source_language target_language (i.e. python translate.py fr en for fr->en translation)

Training results are shown in plot_training_process.ipynb.

Testing results and findings are discussed in the paper.

Credits

The credits for this code go to fanshi118. I've merely created a wrapper to get people started.

how_to_make_a_language_translator's People

Contributors

llsourcell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

how_to_make_a_language_translator's Issues

Dataset

Anyone able to get some good output from this on another dataset?

I have tried to swap out the original dataset with the Cornell movie dialogue dataset but after training for two days on a big GPU I am getting garbage output. So now I am just trying to get it to output the input and again after two days of training the loss is very low but I am getting just a random collection of words. I have replaced the .en .fr files, and removed the old vocab files.

For another test I have created a dataset where the input is three letters of the alphabet and the output is the next three. This actually works, after a few minutes of training it gets perfect accuracy. Not sure why this won't translate to dialogue.

Invalid DATA_DIR

Hey there, how to change the Data directory, I'm getting the following error:

Traceback (most recent call last):
File "C:\Users\Ritesh Maurya\Desktop\How_to_make_a_language_translator\translate.py", line 271, in
tf.app.run()
File "C:\Python35\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "C:\Users\Ritesh Maurya\Desktop\How_to_make_a_language_translator\translate.py", line 266, in main
train()
File "C:\Users\Ritesh Maurya\Desktop\How_to_make_a_language_translator\translate.py", line 118, in train
s_train, t_train, s_dev, t_dev, _, _, _, _ = data_utils.prepare_data(FLAGS.data_dir, FLAGS.s_vocab_size, FLAGS.t_vocab_size, source, target)
File "C:\Users\Ritesh Maurya\Desktop\How_to_make_a_language_translator\data_utils.py", line 201, in prepare_data
s_texts_train = parse_files_to_lists(train_path, source, False)
File "C:\Users\Ritesh Maurya\Desktop\How_to_make_a_language_translator\data_utils.py", line 161, in parse_files_to_lists
texts = f.readlines()
File "C:\Python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 182, in readlines
self._preread_check()
File "C:\Python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 79, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File "C:\Python35\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 473, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: /Users/fancyshmancy/Development/nlp/proj2/data/en-fr/train.tags.en-fr.en : The system cannot find the path specified.

; No such process

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.