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

Subtoken summation #98

Closed 17385 closed 3 years ago

17385 commented 3 years ago

How do you achieve this by summing the subtoken vectors to represent the full token? Thanks

urialon commented 3 years ago

Hi @17385 , Thank you for your interest in code2seq!

I am not sure I understand the question. Yes, we sum the subtoken vectors to represent the full token. This is performed here:

https://github.com/tech-srl/code2seq/blob/428b1896a87e0c34af5a407c709c56047ec99a07/model.py#L531-L532

Best, Uri

17385 commented 3 years ago

Okay, I get it