tech-srl / code2seq

Code for the model presented in the paper: "code2seq: Generating Sequences from Structured Representations of Code"
http://code2seq.org
MIT License
548 stars 165 forks source link

vector extraction from the code #85

Closed permitt closed 3 years ago

permitt commented 3 years ago

I wanted to extract code vectors from the model. I found a way to get the vector for smaller methods, but I have a problem with the extract API you use. It timeouts for my longer methods, and it seems I have a lot of them in my dataset. The problem is with the POST request in extract.py. Is there a way to extend the timeout or solve this problem in another way?

urialon commented 3 years ago

Hi @permitt , Thank you for your interest in code2seq.

The extract API simply wraps the JavaExtractor with a server that accepts POST requests. If your methods (and thus requests) are particularly long, you can use the JavaExtractor "offline" and let it run longer.

Best, Uri

permitt commented 3 years ago

Yes, figured it out in the meanwhile :) Thanks for your answer @urialon !