saltudelft / type4py

Type4Py: Deep Similarity Learning-Based Type Inference for Python
Apache License 2.0
61 stars 13 forks source link

Return fixed amount of type predictions #13

Open Wooza opened 1 year ago

Wooza commented 1 year ago

I experimented with the type prediction (http://localhost:5001/api/predict?tc=0) using the provided docker image. I noticed that depending on the analysed source code, I get different amounts of type predictions per parameter/return/variable type. Is it possible to retrieve a fixed number of predicted types? For example, I would like to retrieve the Top-10 type predictions for each parameter and return type.

Best regards Florian

mir-am commented 1 year ago

I need to look at the code for retrieving the type predictions. We use Annoy, approximate NN, to give suggestions from the learned type cluster. I will update you (@Wooza ) very soon on whether it is possible to give exactly Top-10 predictions.