{"id":16105434,"url":"https://github.com/kennardwang/funcom_reproduction","last_synced_at":"2025-04-06T02:46:25.694Z","repository":{"id":44793467,"uuid":"421503948","full_name":"KennardWang/funcom_reproduction","owner":"KennardWang","description":"Reproduction code for the paper","archived":false,"fork":false,"pushed_at":"2023-11-07T04:43:18.000Z","size":93,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T08:57:47.777Z","etag":null,"topics":["paper","reproduction","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KennardWang.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":"2021-10-26T16:34:53.000Z","updated_at":"2023-08-11T12:04:14.000Z","dependencies_parsed_at":"2023-11-07T06:06:11.103Z","dependency_job_id":null,"html_url":"https://github.com/KennardWang/funcom_reproduction","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennardWang%2Ffuncom_reproduction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennardWang%2Ffuncom_reproduction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennardWang%2Ffuncom_reproduction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KennardWang%2Ffuncom_reproduction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KennardWang","download_url":"https://codeload.github.com/KennardWang/funcom_reproduction/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247426985,"owners_count":20937197,"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":["paper","reproduction","tutorial"],"created_at":"2024-10-09T19:09:34.651Z","updated_at":"2025-04-06T02:46:25.664Z","avatar_url":"https://github.com/KennardWang.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# funcom_reproduction\n\n\u003cdiv align=\"center\"\u003e  \n\n  [![description](https://img.shields.io/badge/paper-Reproduce-DDA0DD?style=for-the-badge)](https://github.com/KennardWang/funcom_reproduction)\n  \u0026nbsp;\n  [![stars](https://img.shields.io/github/stars/KennardWang/funcom_reproduction?style=for-the-badge\u0026color=FDEE21)](https://github.com/KennardWang/funcom_reproduction/stargazers)\n  \u0026nbsp;\n  [![forks](https://img.shields.io/github/forks/KennardWang/funcom_reproduction?style=for-the-badge\u0026color=white)](https://github.com/KennardWang/funcom_reproduction/forks)\n  \u0026nbsp;\n  [![contributors](https://img.shields.io/github/contributors/KennardWang/funcom_reproduction?style=for-the-badge\u0026color=8BC0D0)](https://github.com/KennardWang/funcom_reproduction/graphs/contributors)\n\n  \u003cimg src=\"https://img.shields.io/badge/Colab-F9AB00?style=for-the-badge\u0026logo=googlecolab\u0026color=525252\" /\u003e\n  \u0026nbsp;\n  \u003cimg src=\"https://img.shields.io/badge/Python-D5C100?style=for-the-badge\u0026logo=python\u0026logoColor=blue\" /\u003e\n  \u0026nbsp;\n  \u003cimg src=\"https://img.shields.io/badge/Jupyter-F37626.svg?\u0026style=for-the-badge\u0026logo=Jupyter\u0026logoColor=white\" /\u003e\n  \u0026nbsp;\n  \u003cimg src=\"https://img.shields.io/badge/Keras-FF0000?style=for-the-badge\u0026logo=keras\u0026logoColor=white\" /\u003e\n  \u0026nbsp;\n  \u003cimg src=\"https://img.shields.io/badge/TensorFlow-FF6F00?style=for-the-badge\u0026logo=tensorflow\u0026logoColor=white\" /\u003e\n\u003c/div\u003e\n\n\n\n## Table of Contents\n\n- [Paper Info](#paper-info)\n- [Install](#install)\n- [Usage](#usage)\n- [Maintainers](#maintainers)\n- [Contributing](#contributing)\n- [License](#license)\n\n\n\n## Paper Info\n\n| Title | **A Neural Model for Generating Natural Language Summaries of Program Subroutines** |\n|:---:|:---:|\n| Publication Title | **2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE)** |\n| Authors | **Alexander LeClair, Siyuan Jiang, Collin McMillan** |\n| Repository | [funcom](https://github.com/mcmillco/funcom) |\n\n\n\n## Install\n\n1. Install environment such as Google Colab env, GPU with high RAM. [Google Colab](https://colab.research.google.com/) is an online environment for machine learning and deep learning, which supports Python and Jupyter Notebook. The free version has only basic functionality. For reproduction, I use the Pro version with a high RAM GPU (monthly costs $10.88).\n\n2. Download and unzip `Models` and `Data` at [Release](https://github.com/KennardWang/funcom_reproduction/releases), as well as the source code.\n\n3. Upload the whole `funcom_reproduction` folder to the Google Drive root (everyone has 15GB free storage, I think maybe enough). Create a directory and make sure that the `data` folder is located at `./funcom_reproduction/scratch/funcom/data`.\n\n\n## Usage\n\n1. Before the model training, Please create `outdir` directory under `./funcom_reproduction/scratch/funcom/data`, and then create 3 directories `histories`, `models` and `predictions` respectively under `outdir`. After creation, you can execute steps 0, 0.5, 1 and 2 in the `.ipynb` file for training. The epoch suggested by the author is 5 (each epoch nearly costs more than 2 hours) because the effect will decrease if the **epoch\u003e5**. But in my case, **ast-attendgru** model will abort exceptionally at the 4th epoch so eventually I choose **epoch=3** for comparison. The epoch value can be modified at [line 79 of `train.py`](https://github.com/KennardWang/funcom_reproduction/blob/a04196f56efeffce67df53ac04e3a0c6d9ebd887/train.py#L79). Or you can also use my models in `Models` and skip this step.\n\n2. For comment generation and BLEU score calculation in the standard dataset, the **attendgru** model and **ast-attendgru** model have been released in `Models`. You can directly use them to generate comments for calculating BLEU scores. If you do, please start from step **iii** the following:\n\n    1. Select `outdir_attendgru` or `outdir_ast-attendgru` in `data`, and rename the folder as `outdir`.\n    2. Put the corresponding model file from `Models` under the directory `./funcom_reproduction/scratch/funcom/data/outdir/models`. For example, if you choose `outdir_attendgru`, you need to use `attendgru_E03_1633627453.h5` or `attendgru_E05_1633627453.h5`. Please do not forget to create the `models` directory.\n    3. Open the corresponding `.ipynb` file under the root directory, and execute steps 0, 0.5, 1 and 3. After that, the `.txt` comment will be generated under `./funcom_reproduction/scratch/funcom/data/outdir/predictions`. Please double-check the `.h5` file name before running the code. \n    4. Calculate the BLEU score by executing step 4 in the `.ipynb` file. I leave my results here for checking:\n\n        |Model|Ba|B1|B2|B3|B4|\n        |:---:|:---:|:---:|:---:|:---:|:---:|\n        |ast-attendgru, E03|19.37|38.74|21.88|14.75|11.27|\n        |attendgru, E03|19.24|38.65|21.77|14.66|11.12|\n        |attendgru, E05|19.14|37.88|21.4|14.66|11.3|\n\n3. For comment generation \u0026 BLEU score calculation in the challenge dataset, please modify [line 114 of `predict.py`](https://github.com/KennardWang/funcom_reproduction/blob/a04196f56efeffce67df53ac04e3a0c6d9ebd887/predict.py#L114), and change default value from `False` to `True`. Then, redo steps **iii** and **iv** in the last point.\n\n\n\n## Maintainers\n\n![badge](https://img.shields.io/badge/maintenance-NO-EF2D5E) [@KennardWang](https://github.com/KennardWang)\n\n\n\n## Contributing\n\nFeel free to [open an issue](https://github.com/KennardWang/funcom_reproduction/issues) or submit [PRs](https://github.com/KennardWang/funcom_reproduction/pulls).\n\n\n\n## License\n\n[![license](https://img.shields.io/github/license/KennardWang/funcom_reproduction)](LICENSE) © Kennard Wang ( 2021.10.30 )\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennardwang%2Ffuncom_reproduction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkennardwang%2Ffuncom_reproduction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennardwang%2Ffuncom_reproduction/lists"}