Code Monkey home page Code Monkey logo

transferlearning4code's Introduction

Using Transfer Learning for Code-Related Tasks

In this study, we extend our previous work Studying the usage of text-to-text transfer transformer for code-related tasks paying particular attention at the role played by pre-training and multi-task fine-tuning on the model's performance.

Pipeline

In order to pre-train and then finetune a T5 small model, we need a new sentencepiece model to accommodate the expanded vocabulary given by the java programming language, abstracted java tokens, and technical natural language.

  • How to train a new SPmodel

    Pythonic way

    pip install sentencepiece==0.1.96
    import sentencepiece as spm
    spm.SentencePieceTrainer.train('--input=pretraining.txt --model_prefix=dl4se --vocab_size=32000 --bos_id=-1  --eos_id=1 --unk_id=2 --pad_id=0') 
    

    The new SPmodel has to be trained on the entire pre-training corpus. The tokenizer we trained is available here

  • Set up a GCS Bucket ๐Ÿ’ก

    To Set up a new GCS Bucket for training and fine-tuning a T5 Model, please follow the orignal guide provided by Google . Here the link: https://cloud.google.com/storage/docs/quickstart-console Subsequently, by following the jupyter notebook we provide for pre-train and fine-tune the network, you should be able to set up the final environment.

  • Datasets ๐Ÿ“Ž

    The datasets for the pre-training and the fine-tuning can be found here

  • Pre-trainig/Fine-tuning ๐Ÿ’ป

    To pre-train and then, fine-tune T5, please use the script we provide here:

  • How to generate the predictions ๐Ÿ“ˆ

    First you need to convert the TF model into a pytorch model by using TF_to_Pytorch , then run Generate Results

  • Models ๐Ÿ“Š
  • Predictions: ๐Ÿ“‚ Click Me!
  • Additional: ๐Ÿ“‹

    Under Miscellaneous, you can find the additional script used for computing the statistical tests, the complementary analysis, the overlap and data snooping analysis.

  • Extra: ๐Ÿ“‹
    • Hyperparameters tuning results are available here
    • To navigate the replication package click here

transferlearning4code's People

Contributors

antonio-mastropaolo 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.