Predicting Type Annotations for Python using Embeddings from Graph Neural Networks

Vladimir Ivanov, Vitaly Romanov, Giancarlo Succi

2021

Abstract

An intelligent tool for type annotations in Python would increase the productivity of developers. Python is a dynamic programming language, and predicting types using static analysis is difficult. Existing techniques for type prediction use deep learning models originated in the area of Natural Language Processing. These models depend on the quality of embeddings for source code tokens. We compared approaches for pre-training embeddings for source code. Specifically, we compared FastText embeddings to embeddings trained with Graph Neural Networks (GNN). Our experiments showed that GNN embeddings outperformed FastText embeddings on the task of type prediction. Moreover, they seem to encode complementary information since the prediction quality increases when both types of embeddings are used.

Download


Paper Citation


in Harvard Style

Ivanov V., Romanov V. and Succi G. (2021). Predicting Type Annotations for Python using Embeddings from Graph Neural Networks. In Proceedings of the 23rd International Conference on Enterprise Information Systems - Volume 1: ICEIS, ISBN 978-989-758-509-8, pages 548-556. DOI: 10.5220/0010500305480556


in Bibtex Style

@conference{iceis21,
author={Vladimir Ivanov and Vitaly Romanov and Giancarlo Succi},
title={Predicting Type Annotations for Python using Embeddings from Graph Neural Networks},
booktitle={Proceedings of the 23rd International Conference on Enterprise Information Systems - Volume 1: ICEIS,},
year={2021},
pages={548-556},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0010500305480556},
isbn={978-989-758-509-8},
}


in EndNote Style

TY - CONF

JO - Proceedings of the 23rd International Conference on Enterprise Information Systems - Volume 1: ICEIS,
TI - Predicting Type Annotations for Python using Embeddings from Graph Neural Networks
SN - 978-989-758-509-8
AU - Ivanov V.
AU - Romanov V.
AU - Succi G.
PY - 2021
SP - 548
EP - 556
DO - 10.5220/0010500305480556