Giter Site home page Giter Site logo

ai-program-translation's Introduction

Program Translator AI

Objective

The goal of this project was to make a program translation AI that can convert code from one language to another to help developers in migrating legacy code and make collaboration easier. To this end, we employed a tree-to-tree neural network with encoder-decoder architecture and attention mechanism based on Dr. Chen’s paper.

Dataset

The languages chosen for our project were Javascript and Coffeescript. Our training dataset consisted of 100,000 sample programs and Abstract Syntax Trees.

Model

We used an encoder-decoder architecture with parent-feeding attention in order to better predict the translation for a given node. The encoder is a Tree-LSTM that recursively computes embeddings for each subtree in the source tree from the bottom up. Then, when generating the translated tree, the attention computes the probability that a given node in the source tree corresponds to the node being generated in the target tree. It also chooses the node with the highest probability and passes its embedding to the decoder, which then generates a token in the target language from the embedding.

Web App

This model would then be saved to be used in our Flask web app that takes in a program and displays the translated output.

ai-program-translation's People

Contributors

abetances avatar cange017 avatar chelsea-pierre avatar dcce avatar hbdcaulfield avatar

Watchers

 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.