Home

Awesome

TypeT5: Seq2seq Type Inference using Static Analysis

<img src="data/TypeT5-Workflow.png" width="600" alt="TypeT5 Workflow">

This repo contains the source code for the paper TypeT5: Seq2seq Type Inference using Static Analysis.

@inproceedings{Wei2023TypeT5,
    title={TypeT5: Seq2seq Type Inference using Static Analysis},
    author={Jiayi Wei and Greg Durrett and Isil Dillig},
    booktitle={International Conference on Learning Representations},
    year={2023},
    url={https://openreview.net/forum?id=4TyNEhI2GdN}
}

Installation

This project uses pipenv to manage the package dependencies. Pipenv tracks the exact package versions and manages the (project-specific) virtual environment for you. To install all dependencies, make sure you have pipenv and Python 3.10 installed, then, at the project root, run the following two commands:

pipenv --python <path-to-your-python-3.10>  # create a new environment for this project
pipenv sync --dev # install all specificed dependencies

More about pipenv:

If you are not using pipenv:

Using the trained model

The notebook scripts/run_typet5.ipynb shows you how to download the TypeT5 model from Huggingface and then use it to make type predictions for a specified codebase.

Training a New Model

Development