{"id":21168465,"url":"https://github.com/jetbrains-research/code2seq","last_synced_at":"2025-10-07T20:31:14.498Z","repository":{"id":45064096,"uuid":"274355031","full_name":"JetBrains-Research/code2seq","owner":"JetBrains-Research","description":"PyTorch's implementation of the code2seq model.","archived":false,"fork":false,"pushed_at":"2024-07-25T10:18:22.000Z","size":6434,"stargazers_count":62,"open_issues_count":7,"forks_count":18,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-25T11:19:02.327Z","etag":null,"topics":["code2seq","ml4code","ml4se","pytorch","pytorch-lightning"],"latest_commit_sha":null,"homepage":"","language":"Python","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/JetBrains-Research.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":"2020-06-23T08:43:54.000Z","updated_at":"2025-03-20T16:12:50.000Z","dependencies_parsed_at":"2024-06-21T20:21:34.167Z","dependency_job_id":"b55c7285-aa3f-46b6-8d27-1f8b2ff29b17","html_url":"https://github.com/JetBrains-Research/code2seq","commit_stats":{"total_commits":417,"total_committers":5,"mean_commits":83.4,"dds":0.1918465227817746,"last_synced_commit":"d48c3a28b2f855414c4107dc19692927acb47d9d"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/JetBrains-Research/code2seq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains-Research%2Fcode2seq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains-Research%2Fcode2seq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains-Research%2Fcode2seq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains-Research%2Fcode2seq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JetBrains-Research","download_url":"https://codeload.github.com/JetBrains-Research/code2seq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains-Research%2Fcode2seq/sbom","scorecard":{"id":72398,"data":{"date":"2025-08-11","repo":{"name":"github.com/JetBrains-Research/code2seq","commit":"d48c3a28b2f855414c4107dc19692927acb47d9d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/ubuntu.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/JetBrains-Research/code2seq/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/JetBrains-Research/code2seq/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/JetBrains-Research/code2seq/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ubuntu.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/JetBrains-Research/code2seq/ubuntu.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ubuntu.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/JetBrains-Research/code2seq/ubuntu.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/ubuntu.yml:19","Warn: pipCommand not pinned by hash: .github/workflows/ubuntu.yml:20","Warn: pipCommand not pinned by hash: .github/workflows/ubuntu.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/ubuntu.yml:30","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   5 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:10"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2021-874 / GHSA-2vj5-px25-gjrp","Warn: Project is vulnerable to: GHSA-4cv3-v7pv-rfhf","Warn: Project is vulnerable to: GHSA-98fp-7v67-4v3q","Warn: Project is vulnerable to: PYSEC-2022-181 / GHSA-r5qj-cvf9-p85h","Warn: Project is vulnerable to: GHSA-3749-ghw9-m3mg","Warn: Project is vulnerable to: PYSEC-2022-43015 / GHSA-47fc-vmwq-366v","Warn: Project is vulnerable to: PYSEC-2025-41 / GHSA-53q9-r3pm-6pq6","Warn: Project is vulnerable to: PYSEC-2024-252 / GHSA-5pcm-hx3q-hm94","Warn: Project is vulnerable to: GHSA-887c-mr87-cxwp","Warn: Project is vulnerable to: PYSEC-2024-251 / GHSA-pg7h-5qx3-wjr3","Warn: Project is vulnerable to: PYSEC-2024-250","Warn: Project is vulnerable to: PYSEC-2024-259","Warn: Project is vulnerable to: GHSA-g7vv-2v7x-gj9p"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T04:06:59.531Z","repository_id":45064096,"created_at":"2025-08-15T04:06:59.531Z","updated_at":"2025-08-15T04:06:59.531Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278840416,"owners_count":26055120,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["code2seq","ml4code","ml4se","pytorch","pytorch-lightning"],"created_at":"2024-11-20T15:13:42.316Z","updated_at":"2025-10-07T20:31:14.187Z","avatar_url":"https://github.com/JetBrains-Research.png","language":"Python","readme":"# code2seq\n\n[![JetBrains Research](https://jb.gg/badges/research.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)\n[![Github action: build](https://github.com/SpirinEgor/code2seq/workflows/Build/badge.svg)](https://github.com/SpirinEgor/code2seq/actions?query=workflow%3ABuild)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n\nPyTorch's implementation of code2seq model.\n\n## Installation\n\nYou can easily install model through the PIP:\n```shell\npip install code2seq\n```\n\n## Dataset mining\n\nTo prepare your own dataset with a storage format supported by this implementation, use on the following:\n1. Original dataset preprocessing from vanilla repository\n2. [`astminer`](https://github.com/JetBrains-Research/astminer):\nthe tool for mining path-based representation and more with multiple language support.\n3. [`PSIMiner`](https://github.com/JetBrains-Research/psiminer):\nthe tool for extracting PSI trees from IntelliJ Platform and creating datasets from them.\n## Available checkpoints\n\n### Method name prediction\n| Dataset (with link)                                                                                                     | Checkpoint                                                                                                        | # epochs | F1-score | Precision | Recall | ChrF  |\n|-------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|----------|----------|-----------|--------|-------|\n| [Java-small](https://s3.eu-west-1.amazonaws.com/datasets.ml.labs.aws.intellij.net/java-paths-methods/java-small.tar.gz) | [link](https://s3.eu-west-1.amazonaws.com/datasets.ml.labs.aws.intellij.net/checkpoints/code2seq_java_small.ckpt) | 11       | 41.49    | 54.26     | 33.59  | 30.21 |\n| [Java-med](https://s3.eu-west-1.amazonaws.com/datasets.ml.labs.aws.intellij.net/java-paths-methods/java-med.tar.gz)     | [link](https://s3.eu-west-1.amazonaws.com/datasets.ml.labs.aws.intellij.net/checkpoints/code2seq_java_med.ckpt)   | 10       | 48.17    | 58.87     | 40.76  | 42.32 |\n\n## Configuration\n\nThe model is fully configurable by standalone YAML file.\nNavigate to [config](config) directory to see examples of configs.\n\n## Examples\n\nModel training may be done via PyTorch Lightning trainer.\nSee it [documentation](https://pytorch-lightning.readthedocs.io/en/latest/common/trainer.html) for more information.\n\n```python\nfrom argparse import ArgumentParser\n\nfrom omegaconf import DictConfig, OmegaConf\nfrom pytorch_lightning import Trainer\n\nfrom code2seq.data.path_context_data_module import PathContextDataModule\nfrom code2seq.model import Code2Seq\n\n\ndef train(config: DictConfig):\n    # Define data module\n    data_module = PathContextDataModule(config.data_folder, config.data)\n\n    # Define model\n    model = Code2Seq(\n        config.model,\n        config.optimizer,\n        data_module.vocabulary,\n        config.train.teacher_forcing\n    )\n\n    # Define hyper parameters\n    trainer = Trainer(max_epochs=config.train.n_epochs)\n\n    # Train model\n    trainer.fit(model, datamodule=data_module)\n\n\nif __name__ == \"__main__\":\n    __arg_parser = ArgumentParser()\n    __arg_parser.add_argument(\"config\", help=\"Path to YAML configuration file\", type=str)\n    __args = __arg_parser.parse_args()\n\n    __config = OmegaConf.load(__args.config)\n    train(__config)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetbrains-research%2Fcode2seq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjetbrains-research%2Fcode2seq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetbrains-research%2Fcode2seq/lists"}