persianeval 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. persianeval-0.1.1/.gitignore +28 -0
  2. persianeval-0.1.1/CHANGELOG.md +48 -0
  3. persianeval-0.1.1/LICENSE +201 -0
  4. persianeval-0.1.1/PKG-INFO +246 -0
  5. persianeval-0.1.1/README.md +209 -0
  6. persianeval-0.1.1/docs/adding_a_task.md +92 -0
  7. persianeval-0.1.1/docs/adr/0001-task-design.md +52 -0
  8. persianeval-0.1.1/docs/adr/0002-scoring-policy.md +53 -0
  9. persianeval-0.1.1/docs/adr/0003-leaderboard-freshness.md +48 -0
  10. persianeval-0.1.1/docs/assets/banner.svg +33 -0
  11. persianeval-0.1.1/docs/assets/leaderboard.png +0 -0
  12. persianeval-0.1.1/docs/methodology.md +111 -0
  13. persianeval-0.1.1/pyproject.toml +121 -0
  14. persianeval-0.1.1/results/README.md +1 -0
  15. persianeval-0.1.1/scripts/__init__.py +0 -0
  16. persianeval-0.1.1/scripts/generate_data/__init__.py +0 -0
  17. persianeval-0.1.1/scripts/generate_data/common.py +36 -0
  18. persianeval-0.1.1/scripts/generate_data/gen_bias.py +159 -0
  19. persianeval-0.1.1/scripts/generate_data/gen_code.py +425 -0
  20. persianeval-0.1.1/scripts/generate_data/gen_cultural.py +600 -0
  21. persianeval-0.1.1/scripts/generate_data/gen_rag.py +462 -0
  22. persianeval-0.1.1/scripts/generate_data/gen_reading.py +491 -0
  23. persianeval-0.1.1/scripts/generate_data/gen_reasoning.py +265 -0
  24. persianeval-0.1.1/scripts/generate_data/gen_spelling.py +256 -0
  25. persianeval-0.1.1/scripts/generate_data/gen_translation.py +667 -0
  26. persianeval-0.1.1/scripts/generate_data/run_all.py +52 -0
  27. persianeval-0.1.1/src/persianeval/__init__.py +42 -0
  28. persianeval-0.1.1/src/persianeval/cli.py +154 -0
  29. persianeval-0.1.1/src/persianeval/data/README.md +85 -0
  30. persianeval-0.1.1/src/persianeval/data/v1/SHA256SUMS +8 -0
  31. persianeval-0.1.1/src/persianeval/data/v1/bias_detection.jsonl +200 -0
  32. persianeval-0.1.1/src/persianeval/data/v1/code_with_persian_comments.jsonl +200 -0
  33. persianeval-0.1.1/src/persianeval/data/v1/cultural_knowledge.jsonl +200 -0
  34. persianeval-0.1.1/src/persianeval/data/v1/rag_faithfulness.jsonl +200 -0
  35. persianeval-0.1.1/src/persianeval/data/v1/reading_comprehension.jsonl +200 -0
  36. persianeval-0.1.1/src/persianeval/data/v1/reasoning.jsonl +200 -0
  37. persianeval-0.1.1/src/persianeval/data/v1/spelling.jsonl +200 -0
  38. persianeval-0.1.1/src/persianeval/data/v1/translation_fa_en.jsonl +200 -0
  39. persianeval-0.1.1/src/persianeval/harness/__init__.py +48 -0
  40. persianeval-0.1.1/src/persianeval/harness/providers.py +493 -0
  41. persianeval-0.1.1/src/persianeval/harness/results.py +135 -0
  42. persianeval-0.1.1/src/persianeval/harness/runner.py +284 -0
  43. persianeval-0.1.1/src/persianeval/harness/scorers.py +308 -0
  44. persianeval-0.1.1/src/persianeval/leaderboard/__init__.py +1 -0
  45. persianeval-0.1.1/src/persianeval/leaderboard/generate.py +213 -0
  46. persianeval-0.1.1/src/persianeval/leaderboard/templates/index.html.j2 +162 -0
  47. persianeval-0.1.1/src/persianeval/py.typed +0 -0
  48. persianeval-0.1.1/src/persianeval/tasks/__init__.py +109 -0
  49. persianeval-0.1.1/src/persianeval/tasks/base.py +237 -0
  50. persianeval-0.1.1/src/persianeval/tasks/bias_detection.py +50 -0
  51. persianeval-0.1.1/src/persianeval/tasks/code_with_persian_comments.py +46 -0
  52. persianeval-0.1.1/src/persianeval/tasks/cultural_knowledge.py +30 -0
  53. persianeval-0.1.1/src/persianeval/tasks/rag_faithfulness.py +35 -0
  54. persianeval-0.1.1/src/persianeval/tasks/reading_comprehension.py +28 -0
  55. persianeval-0.1.1/src/persianeval/tasks/reasoning.py +50 -0
  56. persianeval-0.1.1/src/persianeval/tasks/spelling.py +34 -0
  57. persianeval-0.1.1/src/persianeval/tasks/translation_fa_en.py +42 -0
  58. persianeval-0.1.1/tests/test_data_integrity.py +85 -0
  59. persianeval-0.1.1/tests/test_runner.py +387 -0
  60. persianeval-0.1.1/tests/test_scorers.py +109 -0
  61. persianeval-0.1.1/tests/test_tasks.py +154 -0
@@ -0,0 +1,28 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .venv/
8
+ venv/
9
+
10
+ # Tooling caches
11
+ .mypy_cache/
12
+ .ruff_cache/
13
+ .pytest_cache/
14
+ .coverage
15
+ coverage.xml
16
+ htmlcov/
17
+
18
+ # PersianEval runtime artifacts (results are produced by runs / CI, never committed by hand)
19
+ .persianeval_cache/
20
+ results/*
21
+ !results/README.md
22
+
23
+ # OS / editor
24
+ .DS_Store
25
+ .idea/
26
+ .vscode/
27
+
28
+ # Do not ignore the leaderboard output: `leaderboard/` ships a fallback static page.
@@ -0,0 +1,48 @@
1
+ # Changelog
2
+
3
+ All notable changes to PersianEval are documented here.
4
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
5
+ and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.1.1] - 2026-11-15
8
+
9
+ ### Fixed
10
+
11
+ - `cultural_knowledge-0014`: the prompt spelled زیگورات with the Arabic yeh
12
+ (ي); it now uses the Persian ی consistently with the rest of the corpus.
13
+ SHA-256 checksums regenerated.
14
+
15
+ ### Changed
16
+
17
+ - Release workflow: the PyPI publish step is `continue-on-error` until the
18
+ "trusted publisher" is registered on PyPI, keeping release runs green.
19
+
20
+ ## [0.1.0] - 2026-11-12
21
+
22
+ Initial public release.
23
+
24
+ ### Added
25
+
26
+ - **8 evaluation tasks** with frozen, checksummed datasets (1,600 samples total):
27
+ `reasoning` (200), `spelling` (200), `cultural_knowledge` (200),
28
+ `translation_fa_en` (200), `rag_faithfulness` (200), `bias_detection` (200),
29
+ `code_with_persian_comments` (200), `reading_comprehension` (200).
30
+ - **Async harness** (`persianeval.harness`): concurrency with per-provider rate
31
+ limiting, exponential-backoff retries, response caching keyed by
32
+ `provider+model+task+seed+prompt`, JSON + Parquet output with an explicit
33
+ pydantic schema.
34
+ - **Providers**: OpenAI, Anthropic, Ollama, vLLM (OpenAI-compatible) plus
35
+ offline `dummy`/`scripted` providers for pipeline validation.
36
+ - **Scoring**: Persian-aware normalization (homoglyphs, digits, ZWNJ, diacritics),
37
+ exact / fuzzy / LLM-as-judge scorers with public judge prompts.
38
+ - **CLI** (`persianeval`): `tasks`, `run`, `leaderboard` commands with budget
39
+ controls (`--max-tokens`, `--max-requests-per-minute`, `--max-requests`).
40
+ - **Static leaderboard site**: dependency-free sortable table, pure-SVG radar
41
+ chart, `data.json` artifact, empty-state page, generated via Jinja2.
42
+ - **CI**: ruff + `mypy --strict` + pytest (coverage ≥ 80%) on Python 3.11–3.13,
43
+ dataset checksum verification; weekly leaderboard workflow with seeded 50-item
44
+ subsamples (ADR 0003); release workflow with PyPI trusted publishing.
45
+ - **Docs**: bilingual README/methodology/CONTRIBUTING, task-authoring guide,
46
+ three ADRs, CITATION.cff, Code of Conduct.
47
+
48
+ [0.1.0]: https://github.com/Abolfazlrwm/persianeval/releases/tag/v0.1.0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 PersianEval Contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,246 @@
1
+ Metadata-Version: 2.5
2
+ Name: persianeval
3
+ Version: 0.1.1
4
+ Summary: PersianEval: the first serious open-source benchmark for evaluating LLMs on Persian (Farsi) — 8 tasks, reproducible async harness, weekly leaderboard.
5
+ Project-URL: Homepage, https://github.com/Abolfazlrwm/persianeval
6
+ Project-URL: Repository, https://github.com/Abolfazlrwm/persianeval
7
+ Project-URL: Issues, https://github.com/Abolfazlrwm/persianeval/issues
8
+ Project-URL: Changelog, https://github.com/Abolfazlrwm/persianeval/blob/main/CHANGELOG.md
9
+ Project-URL: Documentation, https://github.com/Abolfazlrwm/persianeval/tree/main/docs
10
+ Author: PersianEval Contributors
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: benchmark,evaluation,farsi,llm,low-resource-languages,nlp,persian
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Natural Language :: English
18
+ Classifier: Natural Language :: Persian
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.11
26
+ Requires-Dist: httpx>=0.27
27
+ Requires-Dist: jinja2>=3.1
28
+ Requires-Dist: pyarrow>=16.0
29
+ Requires-Dist: pydantic>=2.7
30
+ Requires-Dist: typer>=0.12
31
+ Provides-Extra: dev
32
+ Requires-Dist: mypy>=1.10; extra == 'dev'
33
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
34
+ Requires-Dist: pytest>=8.2; extra == 'dev'
35
+ Requires-Dist: ruff>=0.5; extra == 'dev'
36
+ Description-Content-Type: text/markdown
37
+
38
+ <div dir="ltr" align="center">
39
+
40
+ <img src="docs/assets/banner.svg" alt="PersianEval — Open-source LLM benchmark for Persian" width="100%">
41
+
42
+ # PersianEval
43
+
44
+ **The first serious open-source benchmark for evaluating LLMs on Persian (Farsi).**
45
+ **اولین بنچمارک متن‌بازِ جدی برای ارزیابی مدل‌های زبانی فارسی**
46
+
47
+ [![CI](https://github.com/Abolfazlrwm/persianeval/actions/workflows/ci.yml/badge.svg)](https://github.com/Abolfazlrwm/persianeval/actions/workflows/ci.yml)
48
+ [![PyPI version](https://img.shields.io/pypi/v/persianeval)](https://pypi.org/project/persianeval/)
49
+ [![Python](https://img.shields.io/pypi/pyversions/persianeval)](https://pypi.org/project/persianeval/)
50
+ [![License](https://img.shields.io/pypi/l/persianeval)](LICENSE)
51
+ [![GitHub stars](https://img.shields.io/github/stars/Abolfazlrwm/persianeval?style=social)](https://github.com/Abolfazlrwm/persianeval/stargazers)
52
+ [![PyPI downloads](https://img.shields.io/pypi/dm/persianeval)](https://pypi.org/project/persianeval/)
53
+
54
+ [English](#english) · [فارسی](#فارسی) · [Leaderboard](https://Abolfazlrwm.github.io/persianeval/)
55
+
56
+ </div>
57
+
58
+ <div dir="ltr">
59
+
60
+ ## English
61
+
62
+ ### Why this project matters
63
+
64
+ Persian is spoken by more than 100 million people, yet the LLM ecosystem has almost no
65
+ *trustworthy* way to measure Persian capability. Popular leaderboards barely cover Farsi,
66
+ translated datasets are often machine-translated and leaked into training data, and the
67
+ challenges that are uniquely Persian — Arabic/Persian homoglyphs (ي/ی، ك/ک), half-space
68
+ rules (نیم‌فاصله), the cultural commons of Iran — are invisible to most benchmarks.
69
+ **PersianEval** fills that gap with 8 frozen, checksummed tasks, a reproducible async
70
+ evaluation harness, and a weekly-updated leaderboard that anyone can audit. Everything —
71
+ code, data, prompts, judge prompts, scores — is Apache-2.0 and open.
72
+
73
+ ### Tasks (8)
74
+
75
+ | Task | What it measures | Scoring | Min samples |
76
+ |---|---|---|---|
77
+ | `reasoning` | Multi-step arithmetic & logic in Persian (GSM8K-style, nativized) | exact | 200 |
78
+ | `reading_comprehension` | Passage + short literal questions | fuzzy ≥ 0.85 | 200 |
79
+ | `spelling` | ي/ی، ك/ك confusion, Arabic digits, ZWNJ (نیم‌فاصله) | fuzzy ≥ 0.90 | 200 |
80
+ | `cultural_knowledge` | Iranian history, literature, geography (MCQ) | exact | 200 |
81
+ | `translation_fa_en` | FA↔EN translation, 4 registers | LLM judge | 200 |
82
+ | `rag_faithfulness` | Is the answer grounded in the passage? (RAG companion) | exact | 200 |
83
+ | `bias_detection` | Stereotype generalization about Iranian groups & gender | LLM judge | 200 |
84
+ | `code_with_persian_comments` | Complete Python functions from Persian specs | LLM judge | 200 |
85
+
86
+ > Every task ships exactly **200 frozen, checksummed samples** in v0.1.0 (1,600 in total) —
87
+ > see [data provenance](src/persianeval/data/README.md) for per-task counts and sources.
88
+
89
+ ### Quickstart
90
+
91
+ ```bash
92
+ pip install persianeval
93
+ export OPENAI_API_KEY=sk-... # or ANTHROPIC_API_KEY / local Ollama
94
+ persianeval tasks # list the 8 tasks
95
+ persianeval run --task reasoning --provider openai --model gpt-4o-mini --rpm 60
96
+ persianeval leaderboard --results-dir results --out leaderboard # static site
97
+ ```
98
+
99
+ Every run is **reproducible**: fixed seed (default 42), temperature 0, responses cached per
100
+ `provider+model+task+seed+prompt` in `.persianeval_cache/`. Cost is controlled with
101
+ `--max-tokens`, `--max-requests-per-minute` and `--max-requests`.
102
+
103
+ ### Sample CLI output
104
+
105
+ ```text
106
+ $ persianeval run --task reasoning --provider dummy --model demo --limit 5
107
+ task=reasoning provider=dummy model=demo seed=42 temperature=0.0 concurrency=4
108
+ --------------------------------------------------------
109
+ accuracy : 0.00% mean score: 0.000
110
+ items : 5 (0 served from cache)
111
+ results : results/reasoning__demo.json
112
+ results : results/reasoning__demo.parquet
113
+ ```
114
+
115
+ Results are written with an explicit pydantic schema (`RunResult`, schema version 1.0) to
116
+ both **JSON** and **Parquet**.
117
+
118
+ ### Leaderboard
119
+
120
+ The [leaderboard](https://Abolfazlrwm.github.io/persianeval/) is a dependency-free static
121
+ page (sortable table + radar chart) regenerated every Monday by
122
+ [`.github/workflows/leaderboard.yml`](.github/workflows/leaderboard.yml), which evaluates
123
+ a rotating seeded sample of open-source models (Qwen 2.5, Llama 3.1, Gemma 2, Aya Expanse)
124
+ through local Ollama runners and publishes the page with GitHub Pages. Raw results are
125
+ linked as `data.json` artifacts.
126
+
127
+ <img src="docs/assets/leaderboard.png" alt="PersianEval leaderboard" width="80%">
128
+
129
+ ### Adding a task in 15 minutes
130
+
131
+ Implement `AbstractTask`, ship a JSONL file with `{"id","prompt","expected","metadata"}`,
132
+ register nothing — the entry-point group `persianeval.tasks` picks external packages up
133
+ automatically. Full walkthrough: [`docs/adding_a_task.md`](docs/adding_a_task.md).
134
+
135
+ ### Contributing
136
+
137
+ PRs welcome — data additions must carry a documented source and a permissive license;
138
+ code must pass `ruff`, `mypy --strict` and `pytest ≥ 80%` coverage (CI enforces all
139
+ three). See [`CONTRIBUTING.md`](CONTRIBUTING.md).
140
+
141
+ ### License & citation
142
+
143
+ Apache-2.0 — free for research and commercial use, including data reuse. If you use
144
+ PersianEval, please cite (see [`CITATION.cff`](CITATION.cff)):
145
+
146
+ ```bibtex
147
+ @software{persianeval2026,
148
+ title = {PersianEval: An Open-Source Benchmark for Persian LLMs},
149
+ author = {PersianEval Contributors},
150
+ year = {2026},
151
+ url = {https://github.com/Abolfazlrwm/persianeval},
152
+ version= {v0.1.0}
153
+ }
154
+ ```
155
+
156
+ </div>
157
+
158
+ <div dir="rtl">
159
+
160
+ ## فارسی
161
+
162
+ ### چرا این پروژه مهم است
163
+
164
+ بیش از ۱۰۰ میلیون نفر فارسی‌زبان‌اند، اما اکوسیستم مدل‌های زبانی تقریباً هیچ راه *قابل
165
+ اعتمادی* برای سنجش توانایی فارسی ندارد. لیدربوردهای معروف فارسی را پوشش نمی‌دهند،
166
+ دیتاست‌های ترجمه‌شده اغلب با ماشین ترجمه شده‌اند و احتمالاً به داده‌های آموزشی نشت کرده‌اند،
167
+ و چالش‌های «تک‌فارسی» — هم‌گردانی عربی/فارسی (ي/ی، ك/ک)، قواعد نیم‌فاصله، دانش فرهنگی
168
+ ایران — در بیشتر بنچمارک‌ها دیده نمی‌شوند. **PersianEval** این خلأ را پر می‌کند: ۸ تسک
169
+ فریزشده و checksumدار، یک هارنس ارزیابی async و تکرارپذیر، و لیدربوردی که هر هفته
170
+ به‌روز می‌شود و هر کسی می‌تواند آن را ممیزی کند. همه‌چیز — کد، داده، پرامپت، پرسش‌های داور و
171
+ نتایج — با لایسنس Apache-2.0 باز است.
172
+
173
+ ### تسک‌ها (۸ تسک)
174
+
175
+ | تسک | چه چیزی را می‌سنجد | امتیازدهی | حداقل نمونه |
176
+ |---|---|---|---|
177
+ | `reasoning` | استدلال چندمرحله‌ای ریاضی و منطقی به فارسی | exact | ۲۰۰ |
178
+ | `reading_comprehension` | متن + پرسش کوتاه مستقیم | fuzzy ≥ ۰٫۸۵ | ۲۰۰ |
179
+ | `spelling` | هم‌گردانی ي/ی و ك/ک، ارقام عربی، نیم‌فاصله | fuzzy ≥ ۰٫۹۰ | ۲۰۰ |
180
+ | `cultural_knowledge` | تاریخ، ادبیات و جغرافیای ایران (چهارگزینه‌ای) | exact | ۲۰۰ |
181
+ | `translation_fa_en` | ترجمهٔ دوسویه در چهار سبک | داور LLM | ۲۰۰ |
182
+ | `rag_faithfulness` | آیا پاسخ به متن وفادار است؟ (مکمل RAG فارسی) | exact | ۲۰۰ |
183
+ | `bias_detection` | تعمیم کلیشه دربارهٔ گروه‌های ایرانی و جنسیت | داور LLM | ۲۰۰ |
184
+ | `code_with_persian_comments` | تکمیل تابع پایتون از توضیح فارسی | داور LLM | ۲۰۰ |
185
+
186
+ > هر ۸ تسک در نسخهٔ 0.1.0 دقیقاً **۲۰۰ نمونهٔ فریزشده و checksumدار** دارند (مجموعاً
187
+ > ۱۶۰۰ نمونه) — شمارش دقیق و منبع هر تسک در
188
+ > [مستند داده‌ها](src/persianeval/data/README.md) آمده است.
189
+
190
+ ### شروع سریع
191
+
192
+ ```bash
193
+ pip install persianeval
194
+ export OPENAI_API_KEY=sk-... # یا ANTHROPIC_API_KEY / مدل محلی با Ollama
195
+ persianeval tasks # فهرست ۸ تسک
196
+ persianeval run --task reasoning --provider openai --model gpt-4o-mini --rpm 60
197
+ persianeval leaderboard --results-dir results --out leaderboard # صفحهٔ استاتیک
198
+ ```
199
+
200
+ هر اجرا **تکرارپذیر** است: seed ثابت (پیش‌فرض ۴۲)، دمای صفر، و کشِ پاسخ به‌ازای
201
+ `provider+model+task+seed+prompt` در `.persianeval_cache/`. هزینه با `--max-tokens`،
202
+ `--max-requests-per-minute` و `--max-requests` کنترل می‌شود.
203
+
204
+ ### خروجی نمونهٔ CLI
205
+
206
+ ```text
207
+ $ persianeval run --task reasoning --provider dummy --model demo --limit 5
208
+ task=reasoning provider=dummy model=demo seed=42 temperature=0.0 concurrency=4
209
+ --------------------------------------------------------
210
+ accuracy : 0.00% mean score: 0.000
211
+ items : 5 (0 served from cache)
212
+ results : results/reasoning__demo.json
213
+ results : results/reasoning__demo.parquet
214
+ ```
215
+
216
+ نتایج با اسکیمای صریح pydantic (`RunResult`، نسخهٔ اسکیما ۱٫۰) در هر دو قالب **JSON** و
217
+ **Parquet** نوشته می‌شوند.
218
+
219
+ ### لیدربورد
220
+
221
+ [لیدربورد](https://Abolfazlrwm.github.io/persianeval/) صفحه‌ای استاتیک و بدون وابستگی است
222
+ (جدول قابل مرتب‌سازی + نمودار رادار) که هر دوشنبه توسط
223
+ [`.github/workflows/leaderboard.yml`](.github/workflows/leaderboard.yml) بازتولید می‌شود؛
224
+ این Action نمونه‌ای چرخشی و seedدار از مدل‌های اپن‌سورس (Qwen 2.5، Llama 3.1، Gemma 2 و
225
+ Aya Expanse) را با Ollama ارزیابی و صفحه را با GitHub Pages منتشر می‌کند. نتایج خام به‌صورت
226
+ `data.json` لینک شده‌اند.
227
+
228
+ ### اضافه‌کردن تسک جدید در ۱۵ دقیقه
229
+
230
+ کافی است `AbstractTask` را پیاده کنید و یک فایل JSONL با اسکیمای
231
+ `{"id","prompt","expected","metadata"}` اضافه کنید؛ پکیج‌های بیرونی هم به‌صورت خودکار از
232
+ طریق گروه entry-point با نام `persianeval.tasks` شناسایی می‌شوند. راهنمای کامل:
233
+ [`docs/adding_a_task.md`](docs/adding_a_task.md).
234
+
235
+ ### مشارکت
236
+
237
+ PR خوش‌آمدید — افزوده‌های داده باید منبع مستند و لایسنس آزاد داشته باشند؛ کد باید
238
+ `ruff`، `mypy --strict` و پوشش تست `pytest ≥ ۸۰٪` را پاس کند (CI هر سه را اجباری می‌کند).
239
+ بیشتر بخوانید: [`CONTRIBUTING.md`](CONTRIBUTING.md).
240
+
241
+ ### لایسنس و ارجاع
242
+
243
+ Apache-2.0 — آزاد برای پژوهش و استفادهٔ تجاری، شامل بازاستفادهٔ داده‌ها. اگر از PersianEval
244
+ استفاده می‌کنید، لطفاً ارجاع دهید (بخش بالا / [`CITATION.cff`](CITATION.cff)).
245
+
246
+ </div>