{"id":13450080,"url":"https://github.com/mast-group/convolutional-attention","last_synced_at":"2025-03-23T16:30:56.389Z","repository":{"id":85414800,"uuid":"58241731","full_name":"mast-group/convolutional-attention","owner":"mast-group","description":"Repository for the code of the \"A Convolutional Attention Network for Extreme Summarization of Source Code\" paper","archived":true,"fork":false,"pushed_at":"2016-07-19T09:27:39.000Z","size":1669,"stargazers_count":119,"open_issues_count":0,"forks_count":31,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-28T17:39:01.626Z","etag":null,"topics":["convolutional-attention-network","machine-learning","ml4code"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mast-group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-07T00:20:14.000Z","updated_at":"2024-05-15T02:58:17.000Z","dependencies_parsed_at":"2023-03-07T03:01:06.847Z","dependency_job_id":null,"html_url":"https://github.com/mast-group/convolutional-attention","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mast-group%2Fconvolutional-attention","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mast-group%2Fconvolutional-attention/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mast-group%2Fconvolutional-attention/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mast-group%2Fconvolutional-attention/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mast-group","download_url":"https://codeload.github.com/mast-group/convolutional-attention/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245130695,"owners_count":20565695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["convolutional-attention-network","machine-learning","ml4code"],"created_at":"2024-07-31T07:00:29.682Z","updated_at":"2025-03-23T16:30:55.257Z","avatar_url":"https://github.com/mast-group.png","language":"HTML","readme":"Convolutional Attention Network\n===============\nCode related to the paper:\n```\n@inproceedings{allamanis2016convolutional,\n  title={A Convolutional Attention Network for Extreme Summarization of Source Code},\n  author={Allamanis, Miltiadis and Peng, Hao and Sutton, Charles},\n  booktitle={International Conference on Machine Learning (ICML)},\n  year={2016}\n}\n```\nFor more information and the data of the paper, see [here](http://groups.inf.ed.ac.uk/cup/codeattention/).\n\nThe project depends on Theano and uses Python 2.7.\n\nUsage Instructions\n======\nTo train the `copy_attention` model with the data use\n```\n\u003e python copy_conv_rec_learner.py \u003ctraining_file\u003e \u003cmax_num_epochs\u003e \u003cD\u003e \u003ctest_file\u003e\n```\nwere `D` is the embedding space dimenssion (128 in paper.)\nThe best model will be saved at `\u003ctraining_file\u003e.pkl`\n\nTo evaluate an existing model re-run with exactly the same parameteres except\nfor `\u003cmax_num_epochs\u003e` which should be zero.\n\nThe following code will generate names from a pre-trained model and a test_file\nwith code examples.\n\n```python\nmodel = ConvolutionalCopyAttentionalRecurrentLearner.load(model_fname)\ntest_data, original_names = model.naming_data.get_data_in_recurrent_copy_convolution_format(test_file, model.padding_size)\ntest_name_targets, test_code_sentences, test_code, test_target_is_unk, test_copy_vectors = test_data\n\nidx = 2  # pick an example from test_file\nres = model.predict_name(np.atleast_2d(test_code[idx]))\nprint \"original name:\", ' '.join(original_names[idx].split(','))\nprint \"code:\", ' '.join(test_code[idx])\nprint \"generated names:\"\nfor r,v in res:\n    print v, ' '.join(r)\n```","funding_links":[],"categories":["Datasets","Software"],"sub_categories":["Code Summarization"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmast-group%2Fconvolutional-attention","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmast-group%2Fconvolutional-attention","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmast-group%2Fconvolutional-attention/lists"}