{"id":18767100,"url":"https://github.com/zorse-project/coboleval","last_synced_at":"2025-04-13T06:32:17.211Z","repository":{"id":230239759,"uuid":"774969181","full_name":"zorse-project/COBOLEval","owner":"zorse-project","description":"Evaluate LLM-generated COBOL","archived":false,"fork":false,"pushed_at":"2024-05-09T11:16:16.000Z","size":143,"stargazers_count":32,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T23:11:44.465Z","etag":null,"topics":["cobol","evaluation","humaneval","llm"],"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/zorse-project.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":"2024-03-20T14:28:16.000Z","updated_at":"2025-03-24T23:40:50.000Z","dependencies_parsed_at":"2024-03-28T16:08:38.352Z","dependency_job_id":"a110ae58-f6ef-422a-83aa-02ca8fd7a2f5","html_url":"https://github.com/zorse-project/COBOLEval","commit_stats":null,"previous_names":["bloopai/coboleval","zorse-project/coboleval"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorse-project%2FCOBOLEval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorse-project%2FCOBOLEval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorse-project%2FCOBOLEval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zorse-project%2FCOBOLEval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zorse-project","download_url":"https://codeload.github.com/zorse-project/COBOLEval/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248674674,"owners_count":21143760,"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":["cobol","evaluation","humaneval","llm"],"created_at":"2024-11-07T19:06:26.554Z","updated_at":"2025-04-13T06:32:16.582Z","avatar_url":"https://github.com/zorse-project.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# COBOLEval: LLM Evaluation for COBOL\n\nCOBOLEval is a dataset to evaluate the code generation abilities of Large Language Models on the COBOL programming language. It is a transpilation of the widely-used [HumanEval](https://github.com/openai/human-eval) benchmark from Python into COBOL. This repo contains both the Python to COBOL transpiler, and an evaluation harness for the dataset.\n\n## Installation\n\nCOBOLEval uses [GnuCOBOL](https://gnucobol.sourceforge.io/) to compile the generated COBOL solutions. Download version 3.2.0 here and follow the installation instructions: https://sourceforge.net/projects/gnucobol/files/.\n\nCheck that the installation was successful with:\n\n```\n\u003e\u003e\u003e cobc -v\ncobc (GnuCOBOL) 3.2.0\n```\n\nUsing Python3.10 or later:\n\n```\npython -m venv coboleval\nsource coboleval/bin/activate\npip install -r requirements.txt\n```\n\nTo run the Python to COBOL transpiler, you'll need to [install Rust](https://www.rust-lang.org/tools/install).\n\n## Usage\n\n**This program runs untrusted model-generated code. Users are strongly encouraged not to do so outside of a robust security sandbox. Following HumanEval, the [execution call](./scripts/evaluation.py#L100) in `evaluation.py` is deliberately commented out to ensure users read this disclaimer before running code in a potentially unsafe manner.**\n\n### Generate completions\n\nConfigure the model and the number of samples-per-problem in `scripts/generate.py` then run. \n\n```python\nif __name__ == \"__main__\":\n    model = Model(name=\"gpt-4\", samples_per_task=1)\n    runner = OpenAIChat(model)\n    runner.eval()\n```\n\nThis will create a `samples.jsonl` file in `preds/gpt-4` which contains the generated COBOL solutions.\n\n### Calculate Pass@k\n\nConfigure the model and the number of samples in the `entrypoint()` function in `scripts/evaluate_functional_correctness.py`:\n\n```python\ndef entrypoint():\n    all_results = []\n    run_folders = [\"gpt-4\"]  # edit\n    for folder in run_folders:\n        all_results.append(eval(f\"preds/{folder}\", \"1\"))\n\n    for res, folder in zip(all_results, run_folders):\n        print(f\"{folder}: {res}\")\n```\n\nOutputs are written to `preds/gpt-4/samples_results.jsonl` and Pass@k is printed:\n\n```\ngpt-4: {'pass@1': 0.10273972602739725}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzorse-project%2Fcoboleval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzorse-project%2Fcoboleval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzorse-project%2Fcoboleval/lists"}