Skip to content

JetBrains-Research/typilus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typilus + Graph generation

On top of Typilus, this repository can be used to generate augmented ASTs that were used in Typilus.

Graph generation

Graph structure

The graphs contain the following edges:

  • CHILD – AST edges
  • NEXT – edges connecting subsequent tokens in code
  • NEXT_USE – next usage of a variable
  • LAST_LEXICAL_USE – previous usage of a variable
  • OCCURRENCES_OF – edges between occurrences of the same variable
  • SUBTOKEN_OF – edges from subtokens to their origin
  • COMPUTED_FROM – edges that point to the origins of a variable
  • RETURNS_TO – edges from return/yield statements to the function definition

Currently, there are no CFG edges.

Graph extraction

  • Go to src/data_preparation/scripts
  • Install dependencies with pip install -r requirements.txt
  • Run python -m graph_generator.run -i {input_dir} -o {output_dir}
  • You can select output format with -f {format}. Currently, dot and jsonl_gz are supported
  • To explore graphs you can use prettyprint_graph in src/data_preparation/scripts/graph_generator/graphgenutils.py

A deep learning algorithm for predicting types in Python. Please find a preprint here.

This repository contains its implementation (src/) and experiments (exp/).

Please cite as:

@inproceedings{allamanis2020typilus,
  title={Typilus: Neural Type Hints},
  author={Allamanis, Miltiadis and Barr, Earl T and Ducousso, Soline and Gao, Zheng},
  booktitle={PLDI},
  year={2020}
}

About

Code for "Typilus: Neural Type Hints" PLDI 2020

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 88.7%
  • Ruby 9.5%
  • Shell 1.6%
  • Dockerfile 0.2%