TL;DR
Type4Py is a deep similarity learning-based model for Python type inference that outperforms previous approaches and is integrated into a VS Code extension for practical use.
Contribution
It introduces a novel deep similarity learning approach trained on a type-checked dataset for more accurate type inference in Python.
Findings
Achieves 77.1% MRR in type prediction.
Outperforms state-of-the-art methods Typilus and TypeWriter.
Provides a practical VS Code extension for developers.
Abstract
Dynamic languages, such as Python and Javascript, trade static typing for developer flexibility and productivity. Lack of static typing can cause run-time exceptions and is a major factor for weak IDE support. To alleviate these issues, PEP 484 introduced optional type annotations for Python. As retrofitting types to existing codebases is error-prone and laborious, machine learning (ML)-based approaches have been proposed to enable automatic type inference based on existing, partially annotated codebases. However, previous ML-based approaches are trained and evaluated on human-provided type annotations, which might not always be sound, and hence this may limit the practicality for real-world usage. In this paper, we present Type4Py, a deep similarity learning-based hierarchical neural network model. It learns to discriminate between similar and dissimilar types in a high-dimensional…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
