English

Import2vec - Learning Embeddings for Software Libraries

Software Engineering 2019-04-09 v1 Information Retrieval Machine Learning Machine Learning

Abstract

We consider the problem of developing suitable learning representations (embeddings) for library packages that capture semantic similarity among libraries. Such representations are known to improve the performance of downstream learning tasks (e.g. classification) or applications such as contextual search and analogical reasoning. We apply word embedding techniques from natural language processing (NLP) to train embeddings for library packages ("library vectors"). Library vectors represent libraries by similar context of use as determined by import statements present in source code. Experimental results obtained from training such embeddings on three large open source software corpora reveals that library vectors capture semantically meaningful relationships among software libraries, such as the relationship between frameworks and their plug-ins and libraries commonly used together within ecosystems such as big data infrastructure projects (in Java), front-end and back-end web development frameworks (in JavaScript) and data science toolkits (in Python).

Keywords

Cite

@article{arxiv.1904.03990,
  title  = {Import2vec - Learning Embeddings for Software Libraries},
  author = {Bart Theeten and Frederik Vandeputte and Tom Van Cutsem},
  journal= {arXiv preprint arXiv:1904.03990},
  year   = {2019}
}

Comments

MSR19 Conference 11 pages

R2 v1 2026-06-23T08:32:45.041Z