shog-ai 0.1.0__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.
- shog_ai-0.1.0/CHANGELOG.md +37 -0
- shog_ai-0.1.0/CONTRIBUTING.md +110 -0
- shog_ai-0.1.0/LICENSE +205 -0
- shog_ai-0.1.0/MANIFEST.in +13 -0
- shog_ai-0.1.0/PKG-INFO +485 -0
- shog_ai-0.1.0/README.md +251 -0
- shog_ai-0.1.0/pyproject.toml +63 -0
- shog_ai-0.1.0/setup.cfg +4 -0
- shog_ai-0.1.0/shog_ai/__init__.py +9 -0
- shog_ai-0.1.0/shog_ai/core/corpus.py +311 -0
- shog_ai-0.1.0/shog_ai/core/deduplicator.py +47 -0
- shog_ai-0.1.0/shog_ai/core/id_generator.py +152 -0
- shog_ai-0.1.0/shog_ai/core/parser.py +124 -0
- shog_ai-0.1.0/shog_ai/core/record.py +193 -0
- shog_ai-0.1.0/shog_ai/core/text_cleaner.py +37 -0
- shog_ai-0.1.0/shog_ai/core/text_normalizer.py +14 -0
- shog_ai-0.1.0/shog_ai/core/validator.py +21 -0
- shog_ai-0.1.0/shog_ai/exporters/csv_exporter.py +0 -0
- shog_ai-0.1.0/shog_ai/exporters/jsonl_exporter.py +22 -0
- shog_ai-0.1.0/shog_ai/exporters/parquet_exporter.py +0 -0
- shog_ai-0.1.0/shog_ai/parsers/__init__.py +7 -0
- shog_ai-0.1.0/shog_ai/parsers/opus.py +131 -0
- shog_ai-0.1.0/shog_ai/parsers/wikipedia.py +111 -0
- shog_ai-0.1.0/shog_ai/pipeline/config.py +96 -0
- shog_ai-0.1.0/shog_ai/pipeline/metadata.py +152 -0
- shog_ai-0.1.0/shog_ai/pipeline/package_writer.py +309 -0
- shog_ai-0.1.0/shog_ai/pipeline/pipeline.py +134 -0
- shog_ai-0.1.0/shog_ai/pipeline/statistics.py +234 -0
- shog_ai-0.1.0/shog_ai/publishers/__init__.py +7 -0
- shog_ai-0.1.0/shog_ai/publishers/huggingface.py +117 -0
- shog_ai-0.1.0/shog_ai/publishers/local.py +74 -0
- shog_ai-0.1.0/shog_ai/utils/types.py +14 -0
- shog_ai-0.1.0/shog_ai.egg-info/PKG-INFO +485 -0
- shog_ai-0.1.0/shog_ai.egg-info/SOURCES.txt +34 -0
- shog_ai-0.1.0/shog_ai.egg-info/dependency_links.txt +1 -0
- shog_ai-0.1.0/shog_ai.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- FLORES-200 parser (planned)
|
|
13
|
+
- OSCAR parser (planned)
|
|
14
|
+
- Common Crawl / CC100 support (planned)
|
|
15
|
+
- Configurable deduplication strategies (planned)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## [0.1.0] - 2026-07-28
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- Initial release of Shog AI.
|
|
24
|
+
- `WikipediaParser` for ingesting Wikipedia dumps via Hugging Face `datasets`.
|
|
25
|
+
- `OpusParser` for OPUS-100 corpora.
|
|
26
|
+
- `Pipeline` and `PipelineConfig` for orchestrating single- and multi-source
|
|
27
|
+
dataset processing with a unified output schema.
|
|
28
|
+
- Standardized record schema (`id`, `source`, `language`, `text`).
|
|
29
|
+
- Output packaging: `data.jsonl`, `metadata.json`, `statistics.json`,
|
|
30
|
+
`manifest.json`.
|
|
31
|
+
- `HuggingFacePublisher` for publishing datasets directly to the Hugging Face
|
|
32
|
+
Hub (token-based and CLI-login auth).
|
|
33
|
+
- `LocalStorage` publisher for saving finished datasets locally.
|
|
34
|
+
- Initial documentation and README.
|
|
35
|
+
|
|
36
|
+
[Unreleased]: https://git@github.com:Perfect-Aimers-Enterprise/shog-ai-data/compare/v0.1.0...HEAD
|
|
37
|
+
[0.1.0]: https://git@github.com:Perfect-Aimers-Enterprise/shog-ai-data/releases/tag/v0.1.0
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Contributing to Shog AI
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing to Shog AI. This project is part of a
|
|
4
|
+
broader research initiative to build multilingual foundation models and open
|
|
5
|
+
data infrastructure, with an emphasis on African languages — contributions of
|
|
6
|
+
all sizes are welcome, from typo fixes to new parsers.
|
|
7
|
+
|
|
8
|
+
## Ways to contribute
|
|
9
|
+
|
|
10
|
+
- **Report bugs** — open an issue with a clear description, steps to
|
|
11
|
+
reproduce, and your environment (Python version, OS, `shog-ai` version).
|
|
12
|
+
- **Suggest features** — open an issue describing the use case before
|
|
13
|
+
submitting a large pull request, so we can align on approach first.
|
|
14
|
+
- **Add a parser** — support for a new dataset source (e.g. FLORES-200,
|
|
15
|
+
OSCAR, Common Crawl).
|
|
16
|
+
- **Improve documentation** — fix unclear explanations, add examples, or
|
|
17
|
+
expand the `docs/` folder.
|
|
18
|
+
- **Write tests** — increase coverage, especially around edge cases in
|
|
19
|
+
parsing, validation, and deduplication.
|
|
20
|
+
|
|
21
|
+
## Getting started
|
|
22
|
+
|
|
23
|
+
1. Fork the repository and clone your fork:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
git clone git@github.com:Perfect-Aimers-Enterprise/shog-ai-data.git
|
|
27
|
+
cd shog-ai
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
2. Create a virtual environment and install in editable mode with dev
|
|
31
|
+
dependencies:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
python -m venv .venv
|
|
35
|
+
source .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
36
|
+
pip install -e ".[dev]"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. Create a branch for your change:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
git checkout -b feature/my-change
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Development guidelines
|
|
46
|
+
|
|
47
|
+
- **Code style** — this project uses [Black](https://github.com/psf/black)
|
|
48
|
+
for formatting and [Ruff](https://github.com/astral-sh/ruff) for linting.
|
|
49
|
+
Run both before committing:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
black .
|
|
53
|
+
ruff check .
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- **Type checking** — public functions and classes should be type-annotated.
|
|
57
|
+
Run [mypy](https://mypy-lang.org/) to check:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
mypy shog_ai
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- **Tests** — add or update tests for any behavior change. Run the test
|
|
64
|
+
suite with:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pytest
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- **Commit messages** — use clear, descriptive commit messages
|
|
71
|
+
(e.g. `feat: add OSCAR parser`, `fix: handle empty language codes`,
|
|
72
|
+
`docs: clarify pipeline config options`).
|
|
73
|
+
|
|
74
|
+
## Adding a new parser
|
|
75
|
+
|
|
76
|
+
New source parsers should follow the existing `WikipediaParser` /
|
|
77
|
+
`OpusParser` pattern: accept the raw dataset, and emit records that match
|
|
78
|
+
the standardized schema:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"id": "...",
|
|
83
|
+
"source": "...",
|
|
84
|
+
"language": "...",
|
|
85
|
+
"text": "..."
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Please include a short usage example and, if possible, a small test fixture
|
|
90
|
+
demonstrating the parser end-to-end.
|
|
91
|
+
|
|
92
|
+
## Submitting a pull request
|
|
93
|
+
|
|
94
|
+
1. Make sure `black`, `ruff`, `mypy`, and `pytest` all pass locally.
|
|
95
|
+
2. Update `CHANGELOG.md` under `[Unreleased]` with a short description of
|
|
96
|
+
your change.
|
|
97
|
+
3. Push your branch and open a pull request against `main`, describing what
|
|
98
|
+
the change does and why.
|
|
99
|
+
4. Be responsive to review feedback — small, focused PRs are easier to
|
|
100
|
+
review and merge quickly.
|
|
101
|
+
|
|
102
|
+
## Code of Conduct
|
|
103
|
+
|
|
104
|
+
By participating in this project, you agree to abide by the
|
|
105
|
+
[Code of Conduct](CODE_OF_CONDUCT.md).
|
|
106
|
+
|
|
107
|
+
## Questions
|
|
108
|
+
|
|
109
|
+
If anything here is unclear, feel free to open an issue or reach out to
|
|
110
|
+
[godsaveogbidor@gmail.com](mailto:godsaveogbidor@gmail.com).
|
shog_ai-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
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
|
|
44
|
+
purposes of this License, Derivative Works shall not include works
|
|
45
|
+
that remain separable from, or merely link (or bind by name) to the
|
|
46
|
+
interfaces of, the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including the
|
|
49
|
+
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
|
|
52
|
+
owner or by an individual or Legal Entity authorized to submit on
|
|
53
|
+
behalf of the copyright owner. For the purposes of this definition,
|
|
54
|
+
"submitted" means any form of electronic, verbal, or written
|
|
55
|
+
communication sent to the Licensor or its representatives,
|
|
56
|
+
including but not limited to communication on electronic mailing
|
|
57
|
+
lists, source code control systems, and issue tracking systems
|
|
58
|
+
that are managed by, or on behalf of, the Licensor for the purpose
|
|
59
|
+
of discussing and improving the Work, but excluding communication
|
|
60
|
+
that is conspicuously marked or otherwise designated in writing
|
|
61
|
+
by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal
|
|
64
|
+
Entity on behalf of whom a Contribution has been received by
|
|
65
|
+
Licensor and subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have
|
|
78
|
+
made, use, offer to sell, sell, import, and otherwise transfer the
|
|
79
|
+
Work, where such license applies only to those patent claims
|
|
80
|
+
licensable by such Contributor that are necessarily infringed by
|
|
81
|
+
their Contribution(s) alone or by combination of their
|
|
82
|
+
Contribution(s) with the Work to which such Contribution(s) was
|
|
83
|
+
submitted. If You institute patent litigation against any entity
|
|
84
|
+
(including a cross-claim or counterclaim in a lawsuit) alleging
|
|
85
|
+
that the Work or a Contribution incorporated within the Work
|
|
86
|
+
constitutes direct or contributory patent infringement, then any
|
|
87
|
+
patent licenses granted to You under this License for that Work
|
|
88
|
+
shall terminate as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
96
|
+
Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute
|
|
109
|
+
must include a readable copy of the attribution notices
|
|
110
|
+
contained within such NOTICE file, excluding those notices
|
|
111
|
+
that do not pertain to any part of the Derivative Works, in
|
|
112
|
+
at least one of the following places: within a NOTICE text
|
|
113
|
+
file distributed as part of the Derivative Works; within the
|
|
114
|
+
Source form or documentation, if provided along with the
|
|
115
|
+
Derivative Works; or, within a display generated by the
|
|
116
|
+
Derivative Works, if and wherever such third-party notices
|
|
117
|
+
normally appear. The contents of the NOTICE file are for
|
|
118
|
+
informational purposes only and do not modify the License.
|
|
119
|
+
You may add Your own attribution notices within Derivative
|
|
120
|
+
Works that You distribute, alongside or as an addendum to
|
|
121
|
+
the NOTICE text from the Work, provided that such additional
|
|
122
|
+
attribution notices cannot be construed as modifying the
|
|
123
|
+
License.
|
|
124
|
+
|
|
125
|
+
You may add Your own copyright statement to Your modifications and
|
|
126
|
+
may provide additional or different license terms and conditions
|
|
127
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
128
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
129
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
130
|
+
the conditions stated in this License.
|
|
131
|
+
|
|
132
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
133
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
134
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
135
|
+
this License, without any additional terms or conditions.
|
|
136
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
137
|
+
the terms of any separate license agreement you may have executed
|
|
138
|
+
with Licensor regarding such Contributions.
|
|
139
|
+
|
|
140
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
141
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
142
|
+
except as required for reasonable and customary use in describing
|
|
143
|
+
the origin of the Work and reproducing the content of the NOTICE
|
|
144
|
+
file.
|
|
145
|
+
|
|
146
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
147
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
148
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
149
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
150
|
+
implied, including, without limitation, any warranties or
|
|
151
|
+
conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS
|
|
152
|
+
FOR A PARTICULAR PURPOSE. You are solely responsible for
|
|
153
|
+
determining the appropriateness of using or redistributing the
|
|
154
|
+
Work and assume any risks associated with Your exercise of
|
|
155
|
+
permissions under this License.
|
|
156
|
+
|
|
157
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
158
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
159
|
+
unless required by applicable law (such as deliberate and grossly
|
|
160
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
161
|
+
liable to You for damages, including any direct, indirect, special,
|
|
162
|
+
incidental, or consequential damages of any character arising as a
|
|
163
|
+
result of this License or out of the use or inability to use the
|
|
164
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
165
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
166
|
+
other commercial damages or losses), even if such Contributor
|
|
167
|
+
has been advised of the possibility of such damages.
|
|
168
|
+
|
|
169
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
170
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
171
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
172
|
+
or other liability obligations and/or rights consistent with this
|
|
173
|
+
License. However, in accepting such obligations, You may act only
|
|
174
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
175
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
176
|
+
defend, and hold each Contributor harmless for any liability
|
|
177
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
178
|
+
of your accepting any such warranty or additional liability.
|
|
179
|
+
|
|
180
|
+
END OF TERMS AND CONDITIONS
|
|
181
|
+
|
|
182
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
183
|
+
|
|
184
|
+
To apply the Apache License to your work, attach the following
|
|
185
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
186
|
+
replaced with your own identifying information. (Don't include
|
|
187
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
188
|
+
comment syntax for the file format. We also recommend that a
|
|
189
|
+
file or class name and description of purpose be included on the
|
|
190
|
+
same "printed page" as the copyright notice for easier
|
|
191
|
+
identification within third-party archives.
|
|
192
|
+
|
|
193
|
+
Copyright 2026 Godsave Kawurem
|
|
194
|
+
|
|
195
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
196
|
+
you may not use this file except in compliance with the License.
|
|
197
|
+
You may obtain a copy of the License at
|
|
198
|
+
|
|
199
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
200
|
+
|
|
201
|
+
Unless required by applicable law or agreed to in writing, software
|
|
202
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
203
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
204
|
+
See the License for the specific language governing permissions and
|
|
205
|
+
limitations under the License.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include CONTRIBUTING.md
|
|
5
|
+
include CODE_OF_CONDUCT.md
|
|
6
|
+
include pyproject.toml
|
|
7
|
+
|
|
8
|
+
recursive-include shog_ai *.py
|
|
9
|
+
recursive-include docs *.md
|
|
10
|
+
|
|
11
|
+
global-exclude __pycache__
|
|
12
|
+
global-exclude *.py[co]
|
|
13
|
+
global-exclude .DS_Store
|