{"id":23792491,"url":"https://github.com/se2p/embeddedkittens","last_synced_at":"2026-02-28T13:05:13.448Z","repository":{"id":258481395,"uuid":"870025040","full_name":"se2p/EmbeddedKittens","owner":"se2p","description":"Converting Scratch projects into the input format for code embedding models.","archived":false,"fork":false,"pushed_at":"2024-10-17T05:30:15.000Z","size":13810,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"github","last_synced_at":"2025-04-13T03:56:25.575Z","etag":null,"topics":["scratch"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/se2p.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-10-09T10:05:53.000Z","updated_at":"2024-10-26T07:35:51.000Z","dependencies_parsed_at":"2024-10-20T11:42:03.596Z","dependency_job_id":null,"html_url":"https://github.com/se2p/EmbeddedKittens","commit_stats":null,"previous_names":["se2p/embeddedkittens"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se2p%2FEmbeddedKittens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se2p%2FEmbeddedKittens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se2p%2FEmbeddedKittens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se2p%2FEmbeddedKittens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/se2p","download_url":"https://codeload.github.com/se2p/EmbeddedKittens/tar.gz/refs/heads/github","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661708,"owners_count":21141450,"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":["scratch"],"created_at":"2025-01-01T18:35:19.127Z","updated_at":"2026-02-28T13:05:08.412Z","avatar_url":"https://github.com/se2p.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![License GPL v3](https://img.shields.io/github/license/se2p/LitterBox?color=blue\u0026style=flat-square)\n\n\u003e Code embeddings are used in machine learning to map source code into a dense vector space.\n\u003e Various models have been proposed to learn this mapping.\n\u003e They use different information from the code (eg just tokens, AST, control/data flow, …) as model input.\n\u003e EmbeddedKittens can be used to extract this information from Scratch projects and transform it into the required format to be used as input for the machine learning model.\n\nEmbeddedKittens[^1] is developed at the\n[Chair of Software Engineering II](https://www.fim.uni-passau.de/lehrstuhl-fuer-software-engineering-ii/)\nof the [University of Passau](https://www.uni-passau.de).\n\nIt originally started as a fork/extension of the Scratch static code analysis tool [LitterBox](https://github.com/se2p/LitterBox).\nInternally, it uses the parser, AST and data flow information as obtained from LitterBox.\n\n\n# Getting started\n\n## Building EmbeddedKittens\n\nEmbeddedKittens is built using [Maven](https://maven.apache.org/).\nTo produce an executable JAR file, run the following command:\n\n```bash\nmvn package\n```\n\n\u003e [!NOTE]\n\u003e Until LitterBox is published on Maven Central you have to install it from the local Maven cache:\n\u003e \n\u003e ```bash\n\u003e # clone LitterBox in version 1.9\n\u003e git clone -b 1.9 https://github.com/se2p/LitterBox\n\u003e cd LitterBox\n\u003e # install the LitterBox JAR into the local Maven Cache so it can be found in this project\n\u003e mvn install -DskipTests\n\u003e ```\n\u003e Now, the `package` command above should work in this repository.\n\nThis will produce `target/embedded-kittens-1.0.full.jar`\n\nPre-built JARs are also available for each release on GitHub.\n\n\n## Using EmbeddedKittens\n\nTo see an overview of the available command line options, type:\n\n```bash\njava -jar embedded-kittens-1.0.full.jar --help\n```\n\nAll the subcommands also accept the `--help` flag to show information about the specific parameters.\nEg\n```bash\njava -jar embedded-kittens-1.0.full.jar code2vec --help\n```\n\n\n## Output formats\n\nThe currently supported formats are suitable for the following models:\n\n- [ASTNN](https://doi.org/10.1109/ICSE.2019.00086)\n- [code2vec](https://doi.org/10.1145/3291636)\n- [code2seq](https://arxiv.org/abs/1808.01400)\n- [GGNN](https://arxiv.org/abs/1711.00740)\n- and tokenised sequences for Transformers/LSTM/…\n\n\n### Example: code2vec output\n\nTo be able to use the code2vec model with the programming language Scratch, a scratch parser is needed to generate the required input representation.\nAccording to the description on https://github.com/tech-srl/code2vec#extending-to-other-languages,\nEmbeddedKittens produces for each Scratch program a file with these rules.\nEmbeddedKittens needs a path to a single file or a folder with multiple projects and produces the output to the declared output folder. \n\n```bash\njava -jar embedded-kittens-1.0.full.jar code2vec \\\n  --output \"\u003cpath/to/folder/for/the/output\u003e\" \\\n  --path \"\u003cpath/to/json/project/or/folder/with/projects\u003e\"\n```\n\nThere are some differences between Scratch and \"normal\" programming languages like Java.\nThe most important is that sprites are primarily split into *unnamed* scripts rather than *named* methods.\nBecause of that, Litterbox uses sprite names like method names and creates path contexts from every single sprite in a project.\n\n\n#### Code2vec output per script\n\nEmbeddedKittens can generate the context paths per scripts and procedures.\nGiven a Scratch program as input, it produces for each script and procedure a file containing the needed input representation for the code2vec model. \n\n```bash\njava -jar embedded-kittens-1.0.full.jar code2vec \\\n  --output \"\u003cpath/to/folder/for/the/output\u003e\" \\\n  --path \"\u003cpath/to/json/project/or/folder/with/projects\u003e\" \\\n  --scripts\n``` \n\n\n## Contributing\n\nPlease open an issue if you find a bug.\nWe are open to pull requests both for fixes and the support of new model formats.\nFor larger features or restructurings, please open an issue first to discuss the best approach on how to best achieve this.\nIf possible, please split larger changes into smaller pull/merge requests to make them easier to review and integrate step-by-step.\n\n\n# Licence\n\nEmbeddedKittens is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or (at\nyour option) any later version.\n\nEmbeddedKittens is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\nGeneral Public License for more details.\n\n\n[^1]: Neither atomic, nor [exploding](https://www.explodingkittens.com/), but peacefully sleeping in vector space.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fse2p%2Fembeddedkittens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fse2p%2Fembeddedkittens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fse2p%2Fembeddedkittens/lists"}