first version
Browse files- .gitattributes +6 -0
- .gitignore +161 -0
- LICENSE +201 -0
- Readme.md +120 -0
- SynStOp.py +198 -0
- generate.py +292 -0
- small/Readme.md +178 -0
- small/about.json +807 -0
- small/stop_10_test.json.gz +3 -0
- small/stop_10_train.json.gz +3 -0
- small/stop_15_test.json.gz +3 -0
- small/stop_15_train.json.gz +3 -0
- small/stop_20_test.json.gz +3 -0
- small/stop_20_train.json.gz +3 -0
- usage.py +16 -0
.gitattributes
CHANGED
@@ -53,3 +53,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
56 |
+
small/stop_10_test.json.gz filter=lfs diff=lfs merge=lfs -text
|
57 |
+
small/stop_10_train.json.gz filter=lfs diff=lfs merge=lfs -text
|
58 |
+
small/stop_15_test.json.gz filter=lfs diff=lfs merge=lfs -text
|
59 |
+
small/stop_15_train.json.gz filter=lfs diff=lfs merge=lfs -text
|
60 |
+
small/stop_20_test.json.gz filter=lfs diff=lfs merge=lfs -text
|
61 |
+
small/stop_20_train.json.gz filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Byte-compiled / optimized / DLL files
|
2 |
+
.idea/
|
3 |
+
__pycache__/
|
4 |
+
*.py[cod]
|
5 |
+
*$py.class
|
6 |
+
|
7 |
+
# C extensions
|
8 |
+
*.so
|
9 |
+
|
10 |
+
# Distribution / packaging
|
11 |
+
.Python
|
12 |
+
build/
|
13 |
+
develop-eggs/
|
14 |
+
dist/
|
15 |
+
downloads/
|
16 |
+
eggs/
|
17 |
+
.eggs/
|
18 |
+
lib/
|
19 |
+
lib64/
|
20 |
+
parts/
|
21 |
+
sdist/
|
22 |
+
var/
|
23 |
+
wheels/
|
24 |
+
share/python-wheels/
|
25 |
+
*.egg-info/
|
26 |
+
.installed.cfg
|
27 |
+
*.egg
|
28 |
+
MANIFEST
|
29 |
+
|
30 |
+
# PyInstaller
|
31 |
+
# Usually these files are written by a python script from a template
|
32 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
33 |
+
*.manifest
|
34 |
+
*.spec
|
35 |
+
|
36 |
+
# Installer logs
|
37 |
+
pip-log.txt
|
38 |
+
pip-delete-this-directory.txt
|
39 |
+
|
40 |
+
# Unit test / coverage reports
|
41 |
+
htmlcov/
|
42 |
+
.tox/
|
43 |
+
.nox/
|
44 |
+
.coverage
|
45 |
+
.coverage.*
|
46 |
+
.cache
|
47 |
+
nosetests.xml
|
48 |
+
coverage.xml
|
49 |
+
*.cover
|
50 |
+
*.py,cover
|
51 |
+
.hypothesis/
|
52 |
+
.pytest_cache/
|
53 |
+
cover/
|
54 |
+
|
55 |
+
# Translations
|
56 |
+
*.mo
|
57 |
+
*.pot
|
58 |
+
|
59 |
+
# Django stuff:
|
60 |
+
*.log
|
61 |
+
local_settings.py
|
62 |
+
db.sqlite3
|
63 |
+
db.sqlite3-journal
|
64 |
+
|
65 |
+
# Flask stuff:
|
66 |
+
instance/
|
67 |
+
.webassets-cache
|
68 |
+
|
69 |
+
# Scrapy stuff:
|
70 |
+
.scrapy
|
71 |
+
|
72 |
+
# Sphinx documentation
|
73 |
+
docs/_build/
|
74 |
+
|
75 |
+
# PyBuilder
|
76 |
+
.pybuilder/
|
77 |
+
target/
|
78 |
+
|
79 |
+
# Jupyter Notebook
|
80 |
+
.ipynb_checkpoints
|
81 |
+
|
82 |
+
# IPython
|
83 |
+
profile_default/
|
84 |
+
ipython_config.py
|
85 |
+
|
86 |
+
# pyenv
|
87 |
+
# For a library or package, you might want to ignore these files since the code is
|
88 |
+
# intended to run in multiple environments; otherwise, check them in:
|
89 |
+
# .python-version
|
90 |
+
|
91 |
+
# pipenv
|
92 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
93 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
94 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
95 |
+
# install all needed dependencies.
|
96 |
+
#Pipfile.lock
|
97 |
+
|
98 |
+
# poetry
|
99 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
100 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
101 |
+
# commonly ignored for libraries.
|
102 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
103 |
+
#poetry.lock
|
104 |
+
|
105 |
+
# pdm
|
106 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
107 |
+
#pdm.lock
|
108 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
109 |
+
# in version control.
|
110 |
+
# https://pdm.fming.dev/#use-with-ide
|
111 |
+
.pdm.toml
|
112 |
+
|
113 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
114 |
+
__pypackages__/
|
115 |
+
|
116 |
+
# Celery stuff
|
117 |
+
celerybeat-schedule
|
118 |
+
celerybeat.pid
|
119 |
+
|
120 |
+
# SageMath parsed files
|
121 |
+
*.sage.py
|
122 |
+
|
123 |
+
# Environments
|
124 |
+
.env
|
125 |
+
.venv
|
126 |
+
env/
|
127 |
+
venv/
|
128 |
+
ENV/
|
129 |
+
env.bak/
|
130 |
+
venv.bak/
|
131 |
+
|
132 |
+
# Spyder project settings
|
133 |
+
.spyderproject
|
134 |
+
.spyproject
|
135 |
+
|
136 |
+
# Rope project settings
|
137 |
+
.ropeproject
|
138 |
+
|
139 |
+
# mkdocs documentation
|
140 |
+
/site
|
141 |
+
|
142 |
+
# mypy
|
143 |
+
.mypy_cache/
|
144 |
+
.dmypy.json
|
145 |
+
dmypy.json
|
146 |
+
|
147 |
+
# Pyre type checker
|
148 |
+
.pyre/
|
149 |
+
|
150 |
+
# pytype static type analyzer
|
151 |
+
.pytype/
|
152 |
+
|
153 |
+
# Cython debug symbols
|
154 |
+
cython_debug/
|
155 |
+
|
156 |
+
# PyCharm
|
157 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
158 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
159 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
160 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
161 |
+
#.idea/
|
LICENSE
ADDED
@@ -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 [yyyy] [name of copyright owner]
|
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.
|
Readme.md
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- synthetic
|
4 |
+
language_creators:
|
5 |
+
- other
|
6 |
+
language:
|
7 |
+
- python
|
8 |
+
license:
|
9 |
+
- Apache 2.0 Licences
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- extended|other
|
16 |
+
task_categories:
|
17 |
+
- token-classification
|
18 |
+
- text-generation
|
19 |
+
task_ids:
|
20 |
+
- natural-language-inference
|
21 |
+
pretty_name: String Operations
|
22 |
+
tags:
|
23 |
+
- development
|
24 |
+
- NLU
|
25 |
+
- small scale
|
26 |
+
dataset_info:
|
27 |
+
- config_name: small
|
28 |
+
features:
|
29 |
+
- name: input
|
30 |
+
dtype: string
|
31 |
+
- name: output
|
32 |
+
dtype: string
|
33 |
+
- name: code
|
34 |
+
dtype: string
|
35 |
+
- name: res_var
|
36 |
+
dtype: string
|
37 |
+
- name: operation
|
38 |
+
dtype: string
|
39 |
+
splits:
|
40 |
+
- name: test
|
41 |
+
num_examples: 14661
|
42 |
+
- name: train
|
43 |
+
num_examples: 33939
|
44 |
+
---
|
45 |
+
|
46 |
+
# Dataset Card for Small String Operations Dataset
|
47 |
+
|
48 |
+
## Dataset Description
|
49 |
+
|
50 |
+
- **Homepage:** [PaDaS Lab](https://huggingface.co/PaDaS-Lab)
|
51 |
+
- **Repository:**
|
52 |
+
- **Paper:**
|
53 |
+
- **Leaderboard:**
|
54 |
+
- **Point of Contact:** Michael Granitzer, [email protected]
|
55 |
+
|
56 |
+
### Other Metadata
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
### Dataset Summary
|
61 |
+
|
62 |
+
Minimal dataset for intended for LM development and testing using python string operations.
|
63 |
+
The dataset is created by running different one line python string operations on random strings
|
64 |
+
The idea is, that transformer implementation can learn the string operations and that this task is a good
|
65 |
+
proxy tasks for other transformer operations on real languages and real tasks. Consequently, the
|
66 |
+
data set is small and can be used in the development process without large scale infrastructures.
|
67 |
+
|
68 |
+
## Dataset Structure
|
69 |
+
|
70 |
+
### Data Instances
|
71 |
+
|
72 |
+
There are different configurations for the data set.
|
73 |
+
|
74 |
+
- `small`: contains below 50k instances of various string length and only contains slicing operations, i.e. all python operations expressable with `s[i:j:s]` (which also includes string reversal).
|
75 |
+
- you can further choose different subsets according to either length or the kind of operation
|
76 |
+
|
77 |
+
### Data Fields
|
78 |
+
|
79 |
+
all data instances can be found under the field "data".
|
80 |
+
|
81 |
+
- `input`: input string, i.e. the string and the string operation
|
82 |
+
- `output`: output of the string operation
|
83 |
+
- `code`: code for running the string operation in python,
|
84 |
+
- `res_var`: name of the result variable
|
85 |
+
- `operation`: kind of operation:
|
86 |
+
- `step_x` for `s[::x]`
|
87 |
+
- `char_at_x` for `s[x]`
|
88 |
+
- `slice_x:y` for `s[x:y]`
|
89 |
+
- `slice_step_x:y:z` for `s[x:y:z]`
|
90 |
+
- `slice_reverse_i:j:k` for `s[i:i+j][::k]`
|
91 |
+
|
92 |
+
Siblings of `data` contain additional metadata information about the dataset.
|
93 |
+
|
94 |
+
- `prompt` describes possible prompts based on that data splitted into input prompts / output prompts
|
95 |
+
|
96 |
+
|
97 |
+
### Data Splits
|
98 |
+
|
99 |
+
The dataset is split into a train and test split for different string lengths
|
100 |
+
|
101 |
+
## Dataset Creation
|
102 |
+
|
103 |
+
The dataset is synthetically created
|
104 |
+
|
105 |
+
### Licensing Information
|
106 |
+
|
107 |
+
MIT License
|
108 |
+
|
109 |
+
### Citation Information
|
110 |
+
|
111 |
+
[More Information Needed]
|
112 |
+
|
113 |
+
### Contributions
|
114 |
+
|
115 |
+
[Chair of Data Science, University of Passau](https://huggingface.co/PaDaS-Lab)
|
116 |
+
|
117 |
+
- Michael Granitzer, University of Passau
|
118 |
+
|
119 |
+
Thanks to [@mgrani](https://github.com/mgrani) for adding this dataset.
|
120 |
+
"""
|
SynStOp.py
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
2 |
+
#
|
3 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
+
# you may not use this file except in compliance with the License.
|
5 |
+
# You may obtain a copy of the License at
|
6 |
+
#
|
7 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
#
|
9 |
+
# Unless required by applicable law or agreed to in writing, software
|
10 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
+
# See the License for the specific language governing permissions and
|
13 |
+
# limitations under the License.
|
14 |
+
"""String Operations Dataset for fast model development"""
|
15 |
+
|
16 |
+
|
17 |
+
import csv
|
18 |
+
import json
|
19 |
+
import os
|
20 |
+
import re
|
21 |
+
|
22 |
+
import datasets
|
23 |
+
import gzip
|
24 |
+
|
25 |
+
# TODO: Add BibTeX citation
|
26 |
+
# Find for instance the citation on arxiv or on the dataset repo/website
|
27 |
+
_CITATION = """\
|
28 |
+
@InProceedings{huggingface:dataset,
|
29 |
+
title = {String Operations Dataset: A small set of string manipulation tasks for fast model development},
|
30 |
+
author={Michael Granitzer},
|
31 |
+
year={2023}
|
32 |
+
}
|
33 |
+
"""
|
34 |
+
|
35 |
+
# TODO: Add description of the dataset here
|
36 |
+
# You can copy an official description
|
37 |
+
_DESCRIPTION = """\
|
38 |
+
Minimal dataset for intended for LM development and testing using python string operations. The dataset is created by running different one line python string operations on random strings The idea is, that transformer implementation can learn the string operations and that this task is a good proxy tasks for other transformer operations on real languages and real tasks. Consequently, the data set is small and can be used in the development process without large scale infrastructures.
|
39 |
+
"""
|
40 |
+
|
41 |
+
# TODO: Add a link to an official homepage for the dataset here
|
42 |
+
_HOMEPAGE = ""
|
43 |
+
|
44 |
+
# TODO: Add the licence for the dataset here if you can find it
|
45 |
+
_LICENSE = "Apache 2.0 License"
|
46 |
+
|
47 |
+
# TODO: Add link to the official dataset URLs here
|
48 |
+
# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
|
49 |
+
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
50 |
+
_URLS = {
|
51 |
+
"small": ["https://github.com/mgrani/StOp-Dataset/raw/main/small/stop_10_train.json.gz",
|
52 |
+
"https://github.com/mgrani/StOp-Dataset/raw/main/small/stop_10_test.json.gz",
|
53 |
+
"https://github.com/mgrani/StOp-Dataset/raw/main/small/stop_20_train.json.gz",
|
54 |
+
"https://github.com/mgrani/StOp-Dataset/raw/main/small/stop_20_test.json.gz",
|
55 |
+
"https://github.com/mgrani/StOp-Dataset/raw/main/small/stop_15_train.json.gz",
|
56 |
+
"https://github.com/mgrani/StOp-Dataset/raw/main/small/stop_15_test.json.gz",
|
57 |
+
"https://github.com/mgrani/StOp-Dataset/raw/main/small/about.json",
|
58 |
+
"https://github.com/mgrani/StOp-Dataset/raw/main/small/Readme.md"]
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
+
# TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
|
63 |
+
class StopDataset(datasets.GeneratorBasedBuilder):
|
64 |
+
"""TODO: Short description of my dataset."""
|
65 |
+
|
66 |
+
VERSION = datasets.Version("0.0.1")
|
67 |
+
|
68 |
+
# If you need to make complex sub-parts in the datasets with configurable options
|
69 |
+
# You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
|
70 |
+
# BUILDER_CONFIG_CLASS = MyBuilderConfig
|
71 |
+
|
72 |
+
# You will be able to load one or the other configurations in the following list with
|
73 |
+
# data = datasets.load_dataset('my_dataset', 'small')
|
74 |
+
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
75 |
+
BUILDER_CONFIGS = [
|
76 |
+
datasets.BuilderConfig(name="small", version=VERSION, description="Small string operations dataset with string slices only"),
|
77 |
+
datasets.BuilderConfig(name="small[filter]", version=VERSION, description="Small string operations dataset with string slices only. [] allows to specify a comma separated list of filters on the length (i.e. l=X) and operations (i.e. o=y)"),
|
78 |
+
|
79 |
+
]
|
80 |
+
|
81 |
+
DEFAULT_CONFIG_NAME = "small" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
82 |
+
|
83 |
+
def _info(self):
|
84 |
+
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
85 |
+
if self.config.name.startswith("small"): # This is the name of the configuration selected in BUILDER_CONFIGS above
|
86 |
+
features = datasets.Features(
|
87 |
+
{
|
88 |
+
"input": datasets.Value("string"),
|
89 |
+
"output": datasets.Value("string"),
|
90 |
+
"code": datasets.Value("string"),
|
91 |
+
"res_var": datasets.Value("string"),
|
92 |
+
"operation": datasets.Value("string")
|
93 |
+
# These are the features of your dataset like images, labels ...
|
94 |
+
}
|
95 |
+
)
|
96 |
+
self._init_filters(self.config.name[len("small"):].strip("[]").split(","))
|
97 |
+
self.config.name= self.config.name[:len("small")]
|
98 |
+
else:
|
99 |
+
raise NotImplementedError()
|
100 |
+
return datasets.DatasetInfo(
|
101 |
+
# This is the description that will appear on the datasets page.
|
102 |
+
description=_DESCRIPTION,
|
103 |
+
# This defines the different columns of the dataset and their types
|
104 |
+
features=features, # Here we define them above because they are different between the two configurations
|
105 |
+
# If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
|
106 |
+
# specify them. They'll be used if as_supervised=True in builder.as_dataset.
|
107 |
+
# supervised_keys=("sentence", "label"),
|
108 |
+
# Homepage of the dataset for documentation
|
109 |
+
homepage=_HOMEPAGE,
|
110 |
+
# License for the dataset if available
|
111 |
+
license=_LICENSE,
|
112 |
+
# Citation for the dataset
|
113 |
+
citation=_CITATION,
|
114 |
+
)
|
115 |
+
|
116 |
+
def _init_filters(self, filters):
|
117 |
+
self.filter_operations = []
|
118 |
+
self.filter_len = []
|
119 |
+
for filter in filters:
|
120 |
+
if filter =="": continue
|
121 |
+
k, v = filter.split("=")
|
122 |
+
if k=="l":
|
123 |
+
self.filter_len.append(int(v))
|
124 |
+
elif k=="o":
|
125 |
+
self.filter_operations.append(re.compile(v))
|
126 |
+
|
127 |
+
def _split_generators(self, dl_manager):
|
128 |
+
# TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
|
129 |
+
# If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
|
130 |
+
|
131 |
+
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
132 |
+
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
133 |
+
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
134 |
+
urls = _URLS[self.config.name]
|
135 |
+
if len(self.filter_len)>0:
|
136 |
+
urls = [url for url in urls if any([f"stop_{str(len)}_t" in url for len in self.filter_len])]
|
137 |
+
data_dir = dl_manager.download_and_extract(urls)
|
138 |
+
return [
|
139 |
+
datasets.SplitGenerator(
|
140 |
+
name=datasets.Split.TRAIN,
|
141 |
+
# These kwargs will be passed to _generate_examples
|
142 |
+
gen_kwargs={
|
143 |
+
"filepath": [data_dir[i] for i, n in enumerate(urls) if "_train.json" in n],
|
144 |
+
"split": "train",
|
145 |
+
},
|
146 |
+
),
|
147 |
+
|
148 |
+
datasets.SplitGenerator(
|
149 |
+
name=datasets.Split.TEST,
|
150 |
+
# These kwargs will be passed to _generate_examples
|
151 |
+
gen_kwargs={
|
152 |
+
"filepath": [data_dir[i] for i, n in enumerate(urls) if "_test.json" in n],
|
153 |
+
"split": "test",
|
154 |
+
},
|
155 |
+
),
|
156 |
+
]
|
157 |
+
|
158 |
+
def _match_operations_filter(self, operation):
|
159 |
+
if self.filter_operations is not None:
|
160 |
+
matches = False
|
161 |
+
for filter in self.filter_operations:
|
162 |
+
if filter.matches(operation):
|
163 |
+
matches = True
|
164 |
+
break
|
165 |
+
return matches
|
166 |
+
else: return True
|
167 |
+
|
168 |
+
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
169 |
+
def _generate_examples(self, filepath, split):
|
170 |
+
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
171 |
+
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
172 |
+
count = 0
|
173 |
+
for filename in filepath:
|
174 |
+
with open(filename, encoding="utf-8") as f:
|
175 |
+
dataset = json.load(f)
|
176 |
+
for ix, data in enumerate(dataset):
|
177 |
+
|
178 |
+
if self.config.name.startswith("small"):
|
179 |
+
|
180 |
+
if self._match_operations_filter(data["operation"]):
|
181 |
+
continue
|
182 |
+
|
183 |
+
# Yields examples as (key, example) tuples
|
184 |
+
id = data["id"] if "id" in data else count
|
185 |
+
count = count + 1
|
186 |
+
yield id, {
|
187 |
+
"input": data["input"],
|
188 |
+
"output": data["output"],
|
189 |
+
"code": data["code"],
|
190 |
+
"res_var": data["res_var"],
|
191 |
+
"operation": data["operation"]
|
192 |
+
}
|
193 |
+
else:
|
194 |
+
yield "", {
|
195 |
+
"sentence": data["sentence"],
|
196 |
+
"option2": data["option2"],
|
197 |
+
"second_domain_answer": "" if split == "test" else data["second_domain_answer"],
|
198 |
+
}
|
generate.py
ADDED
@@ -0,0 +1,292 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
This module generates datasets doing string manipulations
|
3 |
+
"""
|
4 |
+
import enum
|
5 |
+
import random
|
6 |
+
from collections import deque
|
7 |
+
import os
|
8 |
+
import string
|
9 |
+
import json
|
10 |
+
|
11 |
+
|
12 |
+
class StringOperations(str, enum.Enum):
|
13 |
+
|
14 |
+
SLICE = "slicing"
|
15 |
+
STARTS_ENDS_WITH = "starts_ends_with"
|
16 |
+
LEN= "len"
|
17 |
+
CONCAT= "concat"
|
18 |
+
REPEAT= "repeat"
|
19 |
+
UPPER_LOWER_SWAP_CASE= "upper_lower_swap_case"
|
20 |
+
IS= "is"
|
21 |
+
|
22 |
+
|
23 |
+
def generate_random_string(length, charset = None):
|
24 |
+
"""
|
25 |
+
Generates a random string of length length
|
26 |
+
:param length: the length of the string
|
27 |
+
:param alphabet: the alphabet to use
|
28 |
+
:return: the string
|
29 |
+
"""
|
30 |
+
if charset is None:
|
31 |
+
charset = string.ascii_letters + string.digits
|
32 |
+
return ''.join(charset[b % len(charset)] for b in os.urandom(length))
|
33 |
+
|
34 |
+
def generate_reverse_string_prompt(samples, length=20, rev_op="'{sample}'[::-1]",result_var="res", **kwargs):
|
35 |
+
"""
|
36 |
+
provides samples examples of reversing a random string.
|
37 |
+
:param s: the string
|
38 |
+
:return: the reversed string
|
39 |
+
"""
|
40 |
+
for i in range(samples):
|
41 |
+
s = generate_random_string(length)
|
42 |
+
o = rev_op.format(sample=s)
|
43 |
+
yield o, s[::-1], f"{result_var}='{o}'[::-1]", result_var, "reverse"
|
44 |
+
|
45 |
+
def generate_slicing_examples(samples, length=20, #char_at_op="'{sample}'[{pos}]",
|
46 |
+
pos_range=(1,2),
|
47 |
+
slice_range = (1,1),
|
48 |
+
step_size = (1,1),
|
49 |
+
result_var="res", **kwargs):
|
50 |
+
"""
|
51 |
+
provides samples examples of reversing a random string.
|
52 |
+
:param s: the string
|
53 |
+
:return: yields inp, outp, code, res_var, todo_str
|
54 |
+
"""
|
55 |
+
for _ in range(samples):
|
56 |
+
s = generate_random_string(length)
|
57 |
+
for i in range(*pos_range):
|
58 |
+
for j in range(*slice_range):
|
59 |
+
if j == 1: # only one character means no slice
|
60 |
+
o = f"'{s}'[{i}]"
|
61 |
+
yield o, s[i], f"{result_var}={o}", result_var, f"char_at_{i}"
|
62 |
+
else:
|
63 |
+
for k in range(*step_size):
|
64 |
+
if k==0:
|
65 |
+
continue
|
66 |
+
elif j==0 and i==0: # only step size
|
67 |
+
o = f"'{s}'[::{k}]"
|
68 |
+
yield o, s[::k], f"{result_var}={o}", result_var, f"step_::{k}"
|
69 |
+
elif k==1:
|
70 |
+
o = f"'{s}'[{i}:{i+j}]"
|
71 |
+
yield o, s[i:i+j], f"{result_var}={o}", result_var, f"slice_{i}:{i+j}"
|
72 |
+
elif abs(k)<j: # step size needs to be smaller
|
73 |
+
if k>0:
|
74 |
+
o = f"'{s}'[{i}:{i+j}:{k}]"
|
75 |
+
yield o, s[i:i+j:k], f"{result_var}={o}", result_var, f"slice_step_{i}:{i+j}:{k}"
|
76 |
+
else:
|
77 |
+
o = f"'{s}'[{i}:{i+j}][::{k}]"
|
78 |
+
yield o, s[i:i+j][::k], f"{result_var}={o}", result_var, f"slice_reverse_{i}:{i+j}:{k}"
|
79 |
+
|
80 |
+
|
81 |
+
|
82 |
+
class StringOperationGenerator:
|
83 |
+
"""
|
84 |
+
|
85 |
+
|
86 |
+
"""
|
87 |
+
data=None
|
88 |
+
|
89 |
+
|
90 |
+
def set_samples(self, equations):
|
91 |
+
self.equations = equations
|
92 |
+
return self
|
93 |
+
|
94 |
+
@staticmethod
|
95 |
+
def get_prompt(template_name:str = "simple", with_code:bool = False):
|
96 |
+
if template_name == "simple":
|
97 |
+
returns = StringOperationGenerator._get_simple_string_op_prompt()
|
98 |
+
else: returns = StringOperationGenerator._get_plain_prompt()
|
99 |
+
if with_code:
|
100 |
+
returns[-1].extend( [{"templates": ["###ACTION: exec-python\n{code}\n###/ACTION"],
|
101 |
+
"keys": ["code"],
|
102 |
+
"component": "action",},
|
103 |
+
])
|
104 |
+
return returns
|
105 |
+
|
106 |
+
@staticmethod
|
107 |
+
def _get_plain_prompt():
|
108 |
+
"""
|
109 |
+
:return: template for generating value filled equation, e.g. 1+2=3 and mapping needed for the dataset
|
110 |
+
"""
|
111 |
+
inp, out = [], []
|
112 |
+
inp.extend([{"templates": ["{input}="],
|
113 |
+
"keys": ["input"],
|
114 |
+
"component": "input",
|
115 |
+
},
|
116 |
+
])
|
117 |
+
out.extend([{"templates": ["{output}\n"],
|
118 |
+
"keys": ["output"],
|
119 |
+
"component": "output",
|
120 |
+
"tags": ["exact"]}])
|
121 |
+
|
122 |
+
return [inp, out]
|
123 |
+
|
124 |
+
@staticmethod
|
125 |
+
def _get_simple_string_op_prompt():
|
126 |
+
inp, out = [], []
|
127 |
+
# todo: this is a problem here, since the prompt is context sensitive, i.e. it depends on the data.
|
128 |
+
inp.extend([{"templates": ["Conduct the string operation {operation} as follows: {input}.\n"],
|
129 |
+
"keys": ["operation", "input"],
|
130 |
+
"component": "input",
|
131 |
+
},
|
132 |
+
|
133 |
+
])
|
134 |
+
out.extend([{"templates": ["{res_var}={output}\n"],
|
135 |
+
"keys": ["res_var", "output"],
|
136 |
+
"component": "output",
|
137 |
+
"tags": ["exact"]}])
|
138 |
+
|
139 |
+
return [inp, out]
|
140 |
+
|
141 |
+
|
142 |
+
def create_data (self, samples=100, operations=(StringOperations.SLICE),
|
143 |
+
valid_data_only=True, **kwargs):
|
144 |
+
self.data = deque()
|
145 |
+
|
146 |
+
for op in operations:
|
147 |
+
if op==StringOperations.SLICE.value:
|
148 |
+
g = generate_slicing_examples(samples, **kwargs)
|
149 |
+
else:
|
150 |
+
raise NotImplementedError(f"Operation {op} not implemented")
|
151 |
+
for inp, outp, code, res_var, todo_str in g:
|
152 |
+
if valid_data_only and (outp=="" or outp is None): continue
|
153 |
+
self.data.append({"input": inp, "output": outp, "code": code,"res_var": res_var, "operation": todo_str })
|
154 |
+
|
155 |
+
self.data = list(self.data)
|
156 |
+
return self
|
157 |
+
|
158 |
+
def save(self, filename):
|
159 |
+
# load prompts and equations from file
|
160 |
+
import json
|
161 |
+
with open(filename, "w") as f:
|
162 |
+
json.dump(self.data, f)
|
163 |
+
return self
|
164 |
+
|
165 |
+
def load(self, filename):
|
166 |
+
# load data and equations from file
|
167 |
+
import json
|
168 |
+
with open(filename, "r") as f:
|
169 |
+
self.data = json.load(f)
|
170 |
+
return self
|
171 |
+
|
172 |
+
|
173 |
+
def write_data(dump_dir, file, out, compress, indent=2 ):
|
174 |
+
import json, gzip
|
175 |
+
filename = os.path.join(dump_dir, file)
|
176 |
+
if compress:
|
177 |
+
with gzip.open(f'{filename}.gz', 'wt', encoding='utf-8') as f:
|
178 |
+
json.dump(out, f, indent=indent)
|
179 |
+
else:
|
180 |
+
json.dump(out, open(filename, "w"), indent=indent)
|
181 |
+
return filename
|
182 |
+
|
183 |
+
|
184 |
+
def generate_data_for_config(dump_dir, about, s_length = (10,25, 5), pos_range = (0,5), slice_range = (0,4),
|
185 |
+
step_size = (-1,2), samples_per_config = 10, valid_data_only = True):
|
186 |
+
|
187 |
+
samples = samples_per_config * (step_size[1]-step_size[0]) \
|
188 |
+
* (slice_range[1]-slice_range[0])\
|
189 |
+
* (pos_range[1]-pos_range[0])
|
190 |
+
|
191 |
+
about["data_files"] = {"train": [], "test": []}
|
192 |
+
|
193 |
+
markdown = ["", "|Length|Set|Group|Amount|File|", "|---|---|---|---|---|" ]
|
194 |
+
train_total, test_total, id = 0, 0, 1
|
195 |
+
for length in tqdm.tqdm(range(*s_length), desc="Generating data"):
|
196 |
+
generator = StringOperationGenerator()
|
197 |
+
data = generator.create_data(samples=samples,
|
198 |
+
operations=("slicing",),
|
199 |
+
length=length,
|
200 |
+
pos_range=pos_range,
|
201 |
+
slice_range = slice_range,
|
202 |
+
step_size = step_size,
|
203 |
+
valid_data_only=valid_data_only,
|
204 |
+
result_var="res",).data
|
205 |
+
|
206 |
+
for e in data:
|
207 |
+
e["id"] = id
|
208 |
+
id=id+1
|
209 |
+
cnt = Counter([e["operation"] for e in data])
|
210 |
+
test, train = {}, {}
|
211 |
+
for d in cnt.keys(): test[d], train[d] = [], []
|
212 |
+
|
213 |
+
for ix, e in enumerate(data): # not very smart, but it is late
|
214 |
+
if len(test[e["operation"]])>cnt[e["operation"]] *(1-split_ratio):
|
215 |
+
train[e["operation"]].append(e)
|
216 |
+
else:
|
217 |
+
test[e["operation"]].append(e)
|
218 |
+
|
219 |
+
markdown.extend([f"|{length}|train|{k}|{len(v)}|stop_{length}_train.json|" for k, v in train.items()])
|
220 |
+
markdown.extend([f"|{length}|test|{k}|{len(v)}|stop_{length}_train.json|" for k, v in test.items()])
|
221 |
+
|
222 |
+
about["length"]= length
|
223 |
+
about["set"] = "train"
|
224 |
+
data = [v for value in train.values() for v in value]
|
225 |
+
write_data(dump_dir, f"stop_{length}_train.json", data, compress)
|
226 |
+
about["data_files"]["train"].append({"length": length,
|
227 |
+
"files": [f"stop_{length}_train.json"],
|
228 |
+
"entries": len(data),
|
229 |
+
"groups": [{"name": k, "amount": len(v)} for k, v in train.items()]})
|
230 |
+
train_total+=len(data)
|
231 |
+
|
232 |
+
data = [v for value in test.values() for v in value]
|
233 |
+
write_data(dump_dir, f"stop_{length}_test.json", data, compress)
|
234 |
+
about["data_files"]["test"].append({"length": length,
|
235 |
+
"files": [f"stop_{length}_test.json"],
|
236 |
+
"entries": len(data),
|
237 |
+
"groups": [{"name": k, "amount": len(v)} for k, v in test.items()]})
|
238 |
+
test_total+=len(data)
|
239 |
+
|
240 |
+
about["items"] = {"train": train_total, "test": test_total}
|
241 |
+
# now add all about key value pairs except data_files to makrdown varialbe as separate table
|
242 |
+
pre_md = ["# Metadata", "|Key|Value|", "|---|---|"]
|
243 |
+
pre_md.extend([f"|{k}|{v}|" for k, v in about.items() if k!="data_files"])
|
244 |
+
markdown = pre_md + markdown
|
245 |
+
with open(os.path.join(dump_dir, "about.json"), "w") as f:
|
246 |
+
json.dump(about, f, indent=2)
|
247 |
+
|
248 |
+
with open(os.path.join(dump_dir, "Readme.md"), "w") as f:
|
249 |
+
f.write("\n".join(markdown))
|
250 |
+
|
251 |
+
return about, markdown
|
252 |
+
|
253 |
+
|
254 |
+
|
255 |
+
if __name__=="__main__":
|
256 |
+
import datetime, os, tqdm
|
257 |
+
from collections import Counter
|
258 |
+
|
259 |
+
split_ratio = 0.7
|
260 |
+
compress = True
|
261 |
+
about = {
|
262 |
+
"dataset_name" : "StOp-small",
|
263 |
+
"hfuser":"mgrani",
|
264 |
+
"version": "0.0.1",
|
265 |
+
# add date today as created field with the date of now
|
266 |
+
"created" : datetime.datetime.now().strftime("%Y-%m-%d"),
|
267 |
+
"creator" : "Michael Granitzer, [email protected]",
|
268 |
+
"split_ratio" : split_ratio,
|
269 |
+
"prompt": {"plain": StringOperationGenerator.get_prompt(template_name="plain"),
|
270 |
+
"simple": StringOperationGenerator.get_prompt(template_name="simple"),
|
271 |
+
"simple_with_code": StringOperationGenerator.get_prompt(template_name="simple_with_code")}
|
272 |
+
}
|
273 |
+
|
274 |
+
# get the date for today, but nicely formatted as string
|
275 |
+
|
276 |
+
dump_dir = os.path.expanduser("./small")
|
277 |
+
if not os.path.exists(dump_dir): os.mkdir(dump_dir)
|
278 |
+
about, markdown = generate_data_for_config(dump_dir, about, s_length=(10,25, 5), pos_range=(0,5),
|
279 |
+
slice_range=(0,4), step_size=(-1,2), samples_per_config=10,
|
280 |
+
valid_data_only=True)
|
281 |
+
|
282 |
+
|
283 |
+
# with open(os.path.join(dump_dir, "README.md"), "w") as readme:
|
284 |
+
|
285 |
+
# card = StringOperationGenerator.dataset_card(train_total, test_total,
|
286 |
+
# group_stats_table="\n".join(group_stats),
|
287 |
+
# metadata= "\n".join([f"{k}={v}" for k,v in about.items()]))
|
288 |
+
|
289 |
+
# readme.write(card)
|
290 |
+
# readme.close()
|
291 |
+
|
292 |
+
|
small/Readme.md
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Metadata
|
2 |
+
|Key|Value|
|
3 |
+
|---|---|
|
4 |
+
|dataset_name|StOp-small|
|
5 |
+
|hfuser|mgrani|
|
6 |
+
|version|0.0.1|
|
7 |
+
|created|2023-06-28|
|
8 |
+
|creator|Michael Granitzer, [email protected]|
|
9 |
+
|split_ratio|0.7|
|
10 |
+
|prompt|{'plain': [[{'templates': ['{input}='], 'keys': ['input'], 'component': 'input'}], [{'templates': ['{output}\n'], 'keys': ['output'], 'component': 'output', 'tags': ['exact']}]], 'simple': [[{'templates': ['Conduct the string operation {operation} as follows: {input}.\n'], 'keys': ['operation', 'input'], 'component': 'input'}], [{'templates': ['{res_var}={output}\n'], 'keys': ['res_var', 'output'], 'component': 'output', 'tags': ['exact']}]], 'simple_with_code': [[{'templates': ['{input}='], 'keys': ['input'], 'component': 'input'}], [{'templates': ['{output}\n'], 'keys': ['output'], 'component': 'output', 'tags': ['exact']}]]}|
|
11 |
+
|length|20|
|
12 |
+
|set|train|
|
13 |
+
|items|{'train': 33939, 'test': 14661}|
|
14 |
+
|
15 |
+
|Length|Set|Group|Amount|File|
|
16 |
+
|---|---|---|---|---|
|
17 |
+
|10|train|step_::-1|419|stop_10_train.json|
|
18 |
+
|10|train|step_::1|419|stop_10_train.json|
|
19 |
+
|10|train|char_at_0|419|stop_10_train.json|
|
20 |
+
|10|train|slice_reverse_0:2:-1|419|stop_10_train.json|
|
21 |
+
|10|train|slice_0:2|419|stop_10_train.json|
|
22 |
+
|10|train|slice_reverse_0:3:-1|419|stop_10_train.json|
|
23 |
+
|10|train|slice_0:3|419|stop_10_train.json|
|
24 |
+
|10|train|char_at_1|419|stop_10_train.json|
|
25 |
+
|10|train|slice_reverse_1:3:-1|419|stop_10_train.json|
|
26 |
+
|10|train|slice_1:3|419|stop_10_train.json|
|
27 |
+
|10|train|slice_reverse_1:4:-1|419|stop_10_train.json|
|
28 |
+
|10|train|slice_1:4|419|stop_10_train.json|
|
29 |
+
|10|train|char_at_2|419|stop_10_train.json|
|
30 |
+
|10|train|slice_reverse_2:4:-1|419|stop_10_train.json|
|
31 |
+
|10|train|slice_2:4|419|stop_10_train.json|
|
32 |
+
|10|train|slice_reverse_2:5:-1|419|stop_10_train.json|
|
33 |
+
|10|train|slice_2:5|419|stop_10_train.json|
|
34 |
+
|10|train|char_at_3|419|stop_10_train.json|
|
35 |
+
|10|train|slice_reverse_3:5:-1|419|stop_10_train.json|
|
36 |
+
|10|train|slice_3:5|419|stop_10_train.json|
|
37 |
+
|10|train|slice_reverse_3:6:-1|419|stop_10_train.json|
|
38 |
+
|10|train|slice_3:6|419|stop_10_train.json|
|
39 |
+
|10|train|char_at_4|419|stop_10_train.json|
|
40 |
+
|10|train|slice_reverse_4:6:-1|419|stop_10_train.json|
|
41 |
+
|10|train|slice_4:6|419|stop_10_train.json|
|
42 |
+
|10|train|slice_reverse_4:7:-1|419|stop_10_train.json|
|
43 |
+
|10|train|slice_4:7|419|stop_10_train.json|
|
44 |
+
|10|test|step_::-1|181|stop_10_train.json|
|
45 |
+
|10|test|step_::1|181|stop_10_train.json|
|
46 |
+
|10|test|char_at_0|181|stop_10_train.json|
|
47 |
+
|10|test|slice_reverse_0:2:-1|181|stop_10_train.json|
|
48 |
+
|10|test|slice_0:2|181|stop_10_train.json|
|
49 |
+
|10|test|slice_reverse_0:3:-1|181|stop_10_train.json|
|
50 |
+
|10|test|slice_0:3|181|stop_10_train.json|
|
51 |
+
|10|test|char_at_1|181|stop_10_train.json|
|
52 |
+
|10|test|slice_reverse_1:3:-1|181|stop_10_train.json|
|
53 |
+
|10|test|slice_1:3|181|stop_10_train.json|
|
54 |
+
|10|test|slice_reverse_1:4:-1|181|stop_10_train.json|
|
55 |
+
|10|test|slice_1:4|181|stop_10_train.json|
|
56 |
+
|10|test|char_at_2|181|stop_10_train.json|
|
57 |
+
|10|test|slice_reverse_2:4:-1|181|stop_10_train.json|
|
58 |
+
|10|test|slice_2:4|181|stop_10_train.json|
|
59 |
+
|10|test|slice_reverse_2:5:-1|181|stop_10_train.json|
|
60 |
+
|10|test|slice_2:5|181|stop_10_train.json|
|
61 |
+
|10|test|char_at_3|181|stop_10_train.json|
|
62 |
+
|10|test|slice_reverse_3:5:-1|181|stop_10_train.json|
|
63 |
+
|10|test|slice_3:5|181|stop_10_train.json|
|
64 |
+
|10|test|slice_reverse_3:6:-1|181|stop_10_train.json|
|
65 |
+
|10|test|slice_3:6|181|stop_10_train.json|
|
66 |
+
|10|test|char_at_4|181|stop_10_train.json|
|
67 |
+
|10|test|slice_reverse_4:6:-1|181|stop_10_train.json|
|
68 |
+
|10|test|slice_4:6|181|stop_10_train.json|
|
69 |
+
|10|test|slice_reverse_4:7:-1|181|stop_10_train.json|
|
70 |
+
|10|test|slice_4:7|181|stop_10_train.json|
|
71 |
+
|15|train|step_::-1|419|stop_15_train.json|
|
72 |
+
|15|train|step_::1|419|stop_15_train.json|
|
73 |
+
|15|train|char_at_0|419|stop_15_train.json|
|
74 |
+
|15|train|slice_reverse_0:2:-1|419|stop_15_train.json|
|
75 |
+
|15|train|slice_0:2|419|stop_15_train.json|
|
76 |
+
|15|train|slice_reverse_0:3:-1|419|stop_15_train.json|
|
77 |
+
|15|train|slice_0:3|419|stop_15_train.json|
|
78 |
+
|15|train|char_at_1|419|stop_15_train.json|
|
79 |
+
|15|train|slice_reverse_1:3:-1|419|stop_15_train.json|
|
80 |
+
|15|train|slice_1:3|419|stop_15_train.json|
|
81 |
+
|15|train|slice_reverse_1:4:-1|419|stop_15_train.json|
|
82 |
+
|15|train|slice_1:4|419|stop_15_train.json|
|
83 |
+
|15|train|char_at_2|419|stop_15_train.json|
|
84 |
+
|15|train|slice_reverse_2:4:-1|419|stop_15_train.json|
|
85 |
+
|15|train|slice_2:4|419|stop_15_train.json|
|
86 |
+
|15|train|slice_reverse_2:5:-1|419|stop_15_train.json|
|
87 |
+
|15|train|slice_2:5|419|stop_15_train.json|
|
88 |
+
|15|train|char_at_3|419|stop_15_train.json|
|
89 |
+
|15|train|slice_reverse_3:5:-1|419|stop_15_train.json|
|
90 |
+
|15|train|slice_3:5|419|stop_15_train.json|
|
91 |
+
|15|train|slice_reverse_3:6:-1|419|stop_15_train.json|
|
92 |
+
|15|train|slice_3:6|419|stop_15_train.json|
|
93 |
+
|15|train|char_at_4|419|stop_15_train.json|
|
94 |
+
|15|train|slice_reverse_4:6:-1|419|stop_15_train.json|
|
95 |
+
|15|train|slice_4:6|419|stop_15_train.json|
|
96 |
+
|15|train|slice_reverse_4:7:-1|419|stop_15_train.json|
|
97 |
+
|15|train|slice_4:7|419|stop_15_train.json|
|
98 |
+
|15|test|step_::-1|181|stop_15_train.json|
|
99 |
+
|15|test|step_::1|181|stop_15_train.json|
|
100 |
+
|15|test|char_at_0|181|stop_15_train.json|
|
101 |
+
|15|test|slice_reverse_0:2:-1|181|stop_15_train.json|
|
102 |
+
|15|test|slice_0:2|181|stop_15_train.json|
|
103 |
+
|15|test|slice_reverse_0:3:-1|181|stop_15_train.json|
|
104 |
+
|15|test|slice_0:3|181|stop_15_train.json|
|
105 |
+
|15|test|char_at_1|181|stop_15_train.json|
|
106 |
+
|15|test|slice_reverse_1:3:-1|181|stop_15_train.json|
|
107 |
+
|15|test|slice_1:3|181|stop_15_train.json|
|
108 |
+
|15|test|slice_reverse_1:4:-1|181|stop_15_train.json|
|
109 |
+
|15|test|slice_1:4|181|stop_15_train.json|
|
110 |
+
|15|test|char_at_2|181|stop_15_train.json|
|
111 |
+
|15|test|slice_reverse_2:4:-1|181|stop_15_train.json|
|
112 |
+
|15|test|slice_2:4|181|stop_15_train.json|
|
113 |
+
|15|test|slice_reverse_2:5:-1|181|stop_15_train.json|
|
114 |
+
|15|test|slice_2:5|181|stop_15_train.json|
|
115 |
+
|15|test|char_at_3|181|stop_15_train.json|
|
116 |
+
|15|test|slice_reverse_3:5:-1|181|stop_15_train.json|
|
117 |
+
|15|test|slice_3:5|181|stop_15_train.json|
|
118 |
+
|15|test|slice_reverse_3:6:-1|181|stop_15_train.json|
|
119 |
+
|15|test|slice_3:6|181|stop_15_train.json|
|
120 |
+
|15|test|char_at_4|181|stop_15_train.json|
|
121 |
+
|15|test|slice_reverse_4:6:-1|181|stop_15_train.json|
|
122 |
+
|15|test|slice_4:6|181|stop_15_train.json|
|
123 |
+
|15|test|slice_reverse_4:7:-1|181|stop_15_train.json|
|
124 |
+
|15|test|slice_4:7|181|stop_15_train.json|
|
125 |
+
|20|train|step_::-1|419|stop_20_train.json|
|
126 |
+
|20|train|step_::1|419|stop_20_train.json|
|
127 |
+
|20|train|char_at_0|419|stop_20_train.json|
|
128 |
+
|20|train|slice_reverse_0:2:-1|419|stop_20_train.json|
|
129 |
+
|20|train|slice_0:2|419|stop_20_train.json|
|
130 |
+
|20|train|slice_reverse_0:3:-1|419|stop_20_train.json|
|
131 |
+
|20|train|slice_0:3|419|stop_20_train.json|
|
132 |
+
|20|train|char_at_1|419|stop_20_train.json|
|
133 |
+
|20|train|slice_reverse_1:3:-1|419|stop_20_train.json|
|
134 |
+
|20|train|slice_1:3|419|stop_20_train.json|
|
135 |
+
|20|train|slice_reverse_1:4:-1|419|stop_20_train.json|
|
136 |
+
|20|train|slice_1:4|419|stop_20_train.json|
|
137 |
+
|20|train|char_at_2|419|stop_20_train.json|
|
138 |
+
|20|train|slice_reverse_2:4:-1|419|stop_20_train.json|
|
139 |
+
|20|train|slice_2:4|419|stop_20_train.json|
|
140 |
+
|20|train|slice_reverse_2:5:-1|419|stop_20_train.json|
|
141 |
+
|20|train|slice_2:5|419|stop_20_train.json|
|
142 |
+
|20|train|char_at_3|419|stop_20_train.json|
|
143 |
+
|20|train|slice_reverse_3:5:-1|419|stop_20_train.json|
|
144 |
+
|20|train|slice_3:5|419|stop_20_train.json|
|
145 |
+
|20|train|slice_reverse_3:6:-1|419|stop_20_train.json|
|
146 |
+
|20|train|slice_3:6|419|stop_20_train.json|
|
147 |
+
|20|train|char_at_4|419|stop_20_train.json|
|
148 |
+
|20|train|slice_reverse_4:6:-1|419|stop_20_train.json|
|
149 |
+
|20|train|slice_4:6|419|stop_20_train.json|
|
150 |
+
|20|train|slice_reverse_4:7:-1|419|stop_20_train.json|
|
151 |
+
|20|train|slice_4:7|419|stop_20_train.json|
|
152 |
+
|20|test|step_::-1|181|stop_20_train.json|
|
153 |
+
|20|test|step_::1|181|stop_20_train.json|
|
154 |
+
|20|test|char_at_0|181|stop_20_train.json|
|
155 |
+
|20|test|slice_reverse_0:2:-1|181|stop_20_train.json|
|
156 |
+
|20|test|slice_0:2|181|stop_20_train.json|
|
157 |
+
|20|test|slice_reverse_0:3:-1|181|stop_20_train.json|
|
158 |
+
|20|test|slice_0:3|181|stop_20_train.json|
|
159 |
+
|20|test|char_at_1|181|stop_20_train.json|
|
160 |
+
|20|test|slice_reverse_1:3:-1|181|stop_20_train.json|
|
161 |
+
|20|test|slice_1:3|181|stop_20_train.json|
|
162 |
+
|20|test|slice_reverse_1:4:-1|181|stop_20_train.json|
|
163 |
+
|20|test|slice_1:4|181|stop_20_train.json|
|
164 |
+
|20|test|char_at_2|181|stop_20_train.json|
|
165 |
+
|20|test|slice_reverse_2:4:-1|181|stop_20_train.json|
|
166 |
+
|20|test|slice_2:4|181|stop_20_train.json|
|
167 |
+
|20|test|slice_reverse_2:5:-1|181|stop_20_train.json|
|
168 |
+
|20|test|slice_2:5|181|stop_20_train.json|
|
169 |
+
|20|test|char_at_3|181|stop_20_train.json|
|
170 |
+
|20|test|slice_reverse_3:5:-1|181|stop_20_train.json|
|
171 |
+
|20|test|slice_3:5|181|stop_20_train.json|
|
172 |
+
|20|test|slice_reverse_3:6:-1|181|stop_20_train.json|
|
173 |
+
|20|test|slice_3:6|181|stop_20_train.json|
|
174 |
+
|20|test|char_at_4|181|stop_20_train.json|
|
175 |
+
|20|test|slice_reverse_4:6:-1|181|stop_20_train.json|
|
176 |
+
|20|test|slice_4:6|181|stop_20_train.json|
|
177 |
+
|20|test|slice_reverse_4:7:-1|181|stop_20_train.json|
|
178 |
+
|20|test|slice_4:7|181|stop_20_train.json|
|
small/about.json
ADDED
@@ -0,0 +1,807 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"dataset_name": "StOp-small",
|
3 |
+
"hfuser": "mgrani",
|
4 |
+
"version": "0.0.1",
|
5 |
+
"created": "2023-06-28",
|
6 |
+
"creator": "Michael Granitzer, [email protected]",
|
7 |
+
"split_ratio": 0.7,
|
8 |
+
"prompt": {
|
9 |
+
"plain": [
|
10 |
+
[
|
11 |
+
{
|
12 |
+
"templates": [
|
13 |
+
"{input}="
|
14 |
+
],
|
15 |
+
"keys": [
|
16 |
+
"input"
|
17 |
+
],
|
18 |
+
"component": "input"
|
19 |
+
}
|
20 |
+
],
|
21 |
+
[
|
22 |
+
{
|
23 |
+
"templates": [
|
24 |
+
"{output}\n"
|
25 |
+
],
|
26 |
+
"keys": [
|
27 |
+
"output"
|
28 |
+
],
|
29 |
+
"component": "output",
|
30 |
+
"tags": [
|
31 |
+
"exact"
|
32 |
+
]
|
33 |
+
}
|
34 |
+
]
|
35 |
+
],
|
36 |
+
"simple": [
|
37 |
+
[
|
38 |
+
{
|
39 |
+
"templates": [
|
40 |
+
"Conduct the string operation {operation} as follows: {input}.\n"
|
41 |
+
],
|
42 |
+
"keys": [
|
43 |
+
"operation",
|
44 |
+
"input"
|
45 |
+
],
|
46 |
+
"component": "input"
|
47 |
+
}
|
48 |
+
],
|
49 |
+
[
|
50 |
+
{
|
51 |
+
"templates": [
|
52 |
+
"{res_var}={output}\n"
|
53 |
+
],
|
54 |
+
"keys": [
|
55 |
+
"res_var",
|
56 |
+
"output"
|
57 |
+
],
|
58 |
+
"component": "output",
|
59 |
+
"tags": [
|
60 |
+
"exact"
|
61 |
+
]
|
62 |
+
}
|
63 |
+
]
|
64 |
+
],
|
65 |
+
"simple_with_code": [
|
66 |
+
[
|
67 |
+
{
|
68 |
+
"templates": [
|
69 |
+
"{input}="
|
70 |
+
],
|
71 |
+
"keys": [
|
72 |
+
"input"
|
73 |
+
],
|
74 |
+
"component": "input"
|
75 |
+
}
|
76 |
+
],
|
77 |
+
[
|
78 |
+
{
|
79 |
+
"templates": [
|
80 |
+
"{output}\n"
|
81 |
+
],
|
82 |
+
"keys": [
|
83 |
+
"output"
|
84 |
+
],
|
85 |
+
"component": "output",
|
86 |
+
"tags": [
|
87 |
+
"exact"
|
88 |
+
]
|
89 |
+
}
|
90 |
+
]
|
91 |
+
]
|
92 |
+
},
|
93 |
+
"data_files": {
|
94 |
+
"train": [
|
95 |
+
{
|
96 |
+
"length": 10,
|
97 |
+
"files": [
|
98 |
+
"stop_10_train.json"
|
99 |
+
],
|
100 |
+
"entries": 11313,
|
101 |
+
"groups": [
|
102 |
+
{
|
103 |
+
"name": "step_::-1",
|
104 |
+
"amount": 419
|
105 |
+
},
|
106 |
+
{
|
107 |
+
"name": "step_::1",
|
108 |
+
"amount": 419
|
109 |
+
},
|
110 |
+
{
|
111 |
+
"name": "char_at_0",
|
112 |
+
"amount": 419
|
113 |
+
},
|
114 |
+
{
|
115 |
+
"name": "slice_reverse_0:2:-1",
|
116 |
+
"amount": 419
|
117 |
+
},
|
118 |
+
{
|
119 |
+
"name": "slice_0:2",
|
120 |
+
"amount": 419
|
121 |
+
},
|
122 |
+
{
|
123 |
+
"name": "slice_reverse_0:3:-1",
|
124 |
+
"amount": 419
|
125 |
+
},
|
126 |
+
{
|
127 |
+
"name": "slice_0:3",
|
128 |
+
"amount": 419
|
129 |
+
},
|
130 |
+
{
|
131 |
+
"name": "char_at_1",
|
132 |
+
"amount": 419
|
133 |
+
},
|
134 |
+
{
|
135 |
+
"name": "slice_reverse_1:3:-1",
|
136 |
+
"amount": 419
|
137 |
+
},
|
138 |
+
{
|
139 |
+
"name": "slice_1:3",
|
140 |
+
"amount": 419
|
141 |
+
},
|
142 |
+
{
|
143 |
+
"name": "slice_reverse_1:4:-1",
|
144 |
+
"amount": 419
|
145 |
+
},
|
146 |
+
{
|
147 |
+
"name": "slice_1:4",
|
148 |
+
"amount": 419
|
149 |
+
},
|
150 |
+
{
|
151 |
+
"name": "char_at_2",
|
152 |
+
"amount": 419
|
153 |
+
},
|
154 |
+
{
|
155 |
+
"name": "slice_reverse_2:4:-1",
|
156 |
+
"amount": 419
|
157 |
+
},
|
158 |
+
{
|
159 |
+
"name": "slice_2:4",
|
160 |
+
"amount": 419
|
161 |
+
},
|
162 |
+
{
|
163 |
+
"name": "slice_reverse_2:5:-1",
|
164 |
+
"amount": 419
|
165 |
+
},
|
166 |
+
{
|
167 |
+
"name": "slice_2:5",
|
168 |
+
"amount": 419
|
169 |
+
},
|
170 |
+
{
|
171 |
+
"name": "char_at_3",
|
172 |
+
"amount": 419
|
173 |
+
},
|
174 |
+
{
|
175 |
+
"name": "slice_reverse_3:5:-1",
|
176 |
+
"amount": 419
|
177 |
+
},
|
178 |
+
{
|
179 |
+
"name": "slice_3:5",
|
180 |
+
"amount": 419
|
181 |
+
},
|
182 |
+
{
|
183 |
+
"name": "slice_reverse_3:6:-1",
|
184 |
+
"amount": 419
|
185 |
+
},
|
186 |
+
{
|
187 |
+
"name": "slice_3:6",
|
188 |
+
"amount": 419
|
189 |
+
},
|
190 |
+
{
|
191 |
+
"name": "char_at_4",
|
192 |
+
"amount": 419
|
193 |
+
},
|
194 |
+
{
|
195 |
+
"name": "slice_reverse_4:6:-1",
|
196 |
+
"amount": 419
|
197 |
+
},
|
198 |
+
{
|
199 |
+
"name": "slice_4:6",
|
200 |
+
"amount": 419
|
201 |
+
},
|
202 |
+
{
|
203 |
+
"name": "slice_reverse_4:7:-1",
|
204 |
+
"amount": 419
|
205 |
+
},
|
206 |
+
{
|
207 |
+
"name": "slice_4:7",
|
208 |
+
"amount": 419
|
209 |
+
}
|
210 |
+
]
|
211 |
+
},
|
212 |
+
{
|
213 |
+
"length": 15,
|
214 |
+
"files": [
|
215 |
+
"stop_15_train.json"
|
216 |
+
],
|
217 |
+
"entries": 11313,
|
218 |
+
"groups": [
|
219 |
+
{
|
220 |
+
"name": "step_::-1",
|
221 |
+
"amount": 419
|
222 |
+
},
|
223 |
+
{
|
224 |
+
"name": "step_::1",
|
225 |
+
"amount": 419
|
226 |
+
},
|
227 |
+
{
|
228 |
+
"name": "char_at_0",
|
229 |
+
"amount": 419
|
230 |
+
},
|
231 |
+
{
|
232 |
+
"name": "slice_reverse_0:2:-1",
|
233 |
+
"amount": 419
|
234 |
+
},
|
235 |
+
{
|
236 |
+
"name": "slice_0:2",
|
237 |
+
"amount": 419
|
238 |
+
},
|
239 |
+
{
|
240 |
+
"name": "slice_reverse_0:3:-1",
|
241 |
+
"amount": 419
|
242 |
+
},
|
243 |
+
{
|
244 |
+
"name": "slice_0:3",
|
245 |
+
"amount": 419
|
246 |
+
},
|
247 |
+
{
|
248 |
+
"name": "char_at_1",
|
249 |
+
"amount": 419
|
250 |
+
},
|
251 |
+
{
|
252 |
+
"name": "slice_reverse_1:3:-1",
|
253 |
+
"amount": 419
|
254 |
+
},
|
255 |
+
{
|
256 |
+
"name": "slice_1:3",
|
257 |
+
"amount": 419
|
258 |
+
},
|
259 |
+
{
|
260 |
+
"name": "slice_reverse_1:4:-1",
|
261 |
+
"amount": 419
|
262 |
+
},
|
263 |
+
{
|
264 |
+
"name": "slice_1:4",
|
265 |
+
"amount": 419
|
266 |
+
},
|
267 |
+
{
|
268 |
+
"name": "char_at_2",
|
269 |
+
"amount": 419
|
270 |
+
},
|
271 |
+
{
|
272 |
+
"name": "slice_reverse_2:4:-1",
|
273 |
+
"amount": 419
|
274 |
+
},
|
275 |
+
{
|
276 |
+
"name": "slice_2:4",
|
277 |
+
"amount": 419
|
278 |
+
},
|
279 |
+
{
|
280 |
+
"name": "slice_reverse_2:5:-1",
|
281 |
+
"amount": 419
|
282 |
+
},
|
283 |
+
{
|
284 |
+
"name": "slice_2:5",
|
285 |
+
"amount": 419
|
286 |
+
},
|
287 |
+
{
|
288 |
+
"name": "char_at_3",
|
289 |
+
"amount": 419
|
290 |
+
},
|
291 |
+
{
|
292 |
+
"name": "slice_reverse_3:5:-1",
|
293 |
+
"amount": 419
|
294 |
+
},
|
295 |
+
{
|
296 |
+
"name": "slice_3:5",
|
297 |
+
"amount": 419
|
298 |
+
},
|
299 |
+
{
|
300 |
+
"name": "slice_reverse_3:6:-1",
|
301 |
+
"amount": 419
|
302 |
+
},
|
303 |
+
{
|
304 |
+
"name": "slice_3:6",
|
305 |
+
"amount": 419
|
306 |
+
},
|
307 |
+
{
|
308 |
+
"name": "char_at_4",
|
309 |
+
"amount": 419
|
310 |
+
},
|
311 |
+
{
|
312 |
+
"name": "slice_reverse_4:6:-1",
|
313 |
+
"amount": 419
|
314 |
+
},
|
315 |
+
{
|
316 |
+
"name": "slice_4:6",
|
317 |
+
"amount": 419
|
318 |
+
},
|
319 |
+
{
|
320 |
+
"name": "slice_reverse_4:7:-1",
|
321 |
+
"amount": 419
|
322 |
+
},
|
323 |
+
{
|
324 |
+
"name": "slice_4:7",
|
325 |
+
"amount": 419
|
326 |
+
}
|
327 |
+
]
|
328 |
+
},
|
329 |
+
{
|
330 |
+
"length": 20,
|
331 |
+
"files": [
|
332 |
+
"stop_20_train.json"
|
333 |
+
],
|
334 |
+
"entries": 11313,
|
335 |
+
"groups": [
|
336 |
+
{
|
337 |
+
"name": "step_::-1",
|
338 |
+
"amount": 419
|
339 |
+
},
|
340 |
+
{
|
341 |
+
"name": "step_::1",
|
342 |
+
"amount": 419
|
343 |
+
},
|
344 |
+
{
|
345 |
+
"name": "char_at_0",
|
346 |
+
"amount": 419
|
347 |
+
},
|
348 |
+
{
|
349 |
+
"name": "slice_reverse_0:2:-1",
|
350 |
+
"amount": 419
|
351 |
+
},
|
352 |
+
{
|
353 |
+
"name": "slice_0:2",
|
354 |
+
"amount": 419
|
355 |
+
},
|
356 |
+
{
|
357 |
+
"name": "slice_reverse_0:3:-1",
|
358 |
+
"amount": 419
|
359 |
+
},
|
360 |
+
{
|
361 |
+
"name": "slice_0:3",
|
362 |
+
"amount": 419
|
363 |
+
},
|
364 |
+
{
|
365 |
+
"name": "char_at_1",
|
366 |
+
"amount": 419
|
367 |
+
},
|
368 |
+
{
|
369 |
+
"name": "slice_reverse_1:3:-1",
|
370 |
+
"amount": 419
|
371 |
+
},
|
372 |
+
{
|
373 |
+
"name": "slice_1:3",
|
374 |
+
"amount": 419
|
375 |
+
},
|
376 |
+
{
|
377 |
+
"name": "slice_reverse_1:4:-1",
|
378 |
+
"amount": 419
|
379 |
+
},
|
380 |
+
{
|
381 |
+
"name": "slice_1:4",
|
382 |
+
"amount": 419
|
383 |
+
},
|
384 |
+
{
|
385 |
+
"name": "char_at_2",
|
386 |
+
"amount": 419
|
387 |
+
},
|
388 |
+
{
|
389 |
+
"name": "slice_reverse_2:4:-1",
|
390 |
+
"amount": 419
|
391 |
+
},
|
392 |
+
{
|
393 |
+
"name": "slice_2:4",
|
394 |
+
"amount": 419
|
395 |
+
},
|
396 |
+
{
|
397 |
+
"name": "slice_reverse_2:5:-1",
|
398 |
+
"amount": 419
|
399 |
+
},
|
400 |
+
{
|
401 |
+
"name": "slice_2:5",
|
402 |
+
"amount": 419
|
403 |
+
},
|
404 |
+
{
|
405 |
+
"name": "char_at_3",
|
406 |
+
"amount": 419
|
407 |
+
},
|
408 |
+
{
|
409 |
+
"name": "slice_reverse_3:5:-1",
|
410 |
+
"amount": 419
|
411 |
+
},
|
412 |
+
{
|
413 |
+
"name": "slice_3:5",
|
414 |
+
"amount": 419
|
415 |
+
},
|
416 |
+
{
|
417 |
+
"name": "slice_reverse_3:6:-1",
|
418 |
+
"amount": 419
|
419 |
+
},
|
420 |
+
{
|
421 |
+
"name": "slice_3:6",
|
422 |
+
"amount": 419
|
423 |
+
},
|
424 |
+
{
|
425 |
+
"name": "char_at_4",
|
426 |
+
"amount": 419
|
427 |
+
},
|
428 |
+
{
|
429 |
+
"name": "slice_reverse_4:6:-1",
|
430 |
+
"amount": 419
|
431 |
+
},
|
432 |
+
{
|
433 |
+
"name": "slice_4:6",
|
434 |
+
"amount": 419
|
435 |
+
},
|
436 |
+
{
|
437 |
+
"name": "slice_reverse_4:7:-1",
|
438 |
+
"amount": 419
|
439 |
+
},
|
440 |
+
{
|
441 |
+
"name": "slice_4:7",
|
442 |
+
"amount": 419
|
443 |
+
}
|
444 |
+
]
|
445 |
+
}
|
446 |
+
],
|
447 |
+
"test": [
|
448 |
+
{
|
449 |
+
"length": 10,
|
450 |
+
"files": [
|
451 |
+
"stop_10_test.json"
|
452 |
+
],
|
453 |
+
"entries": 4887,
|
454 |
+
"groups": [
|
455 |
+
{
|
456 |
+
"name": "step_::-1",
|
457 |
+
"amount": 181
|
458 |
+
},
|
459 |
+
{
|
460 |
+
"name": "step_::1",
|
461 |
+
"amount": 181
|
462 |
+
},
|
463 |
+
{
|
464 |
+
"name": "char_at_0",
|
465 |
+
"amount": 181
|
466 |
+
},
|
467 |
+
{
|
468 |
+
"name": "slice_reverse_0:2:-1",
|
469 |
+
"amount": 181
|
470 |
+
},
|
471 |
+
{
|
472 |
+
"name": "slice_0:2",
|
473 |
+
"amount": 181
|
474 |
+
},
|
475 |
+
{
|
476 |
+
"name": "slice_reverse_0:3:-1",
|
477 |
+
"amount": 181
|
478 |
+
},
|
479 |
+
{
|
480 |
+
"name": "slice_0:3",
|
481 |
+
"amount": 181
|
482 |
+
},
|
483 |
+
{
|
484 |
+
"name": "char_at_1",
|
485 |
+
"amount": 181
|
486 |
+
},
|
487 |
+
{
|
488 |
+
"name": "slice_reverse_1:3:-1",
|
489 |
+
"amount": 181
|
490 |
+
},
|
491 |
+
{
|
492 |
+
"name": "slice_1:3",
|
493 |
+
"amount": 181
|
494 |
+
},
|
495 |
+
{
|
496 |
+
"name": "slice_reverse_1:4:-1",
|
497 |
+
"amount": 181
|
498 |
+
},
|
499 |
+
{
|
500 |
+
"name": "slice_1:4",
|
501 |
+
"amount": 181
|
502 |
+
},
|
503 |
+
{
|
504 |
+
"name": "char_at_2",
|
505 |
+
"amount": 181
|
506 |
+
},
|
507 |
+
{
|
508 |
+
"name": "slice_reverse_2:4:-1",
|
509 |
+
"amount": 181
|
510 |
+
},
|
511 |
+
{
|
512 |
+
"name": "slice_2:4",
|
513 |
+
"amount": 181
|
514 |
+
},
|
515 |
+
{
|
516 |
+
"name": "slice_reverse_2:5:-1",
|
517 |
+
"amount": 181
|
518 |
+
},
|
519 |
+
{
|
520 |
+
"name": "slice_2:5",
|
521 |
+
"amount": 181
|
522 |
+
},
|
523 |
+
{
|
524 |
+
"name": "char_at_3",
|
525 |
+
"amount": 181
|
526 |
+
},
|
527 |
+
{
|
528 |
+
"name": "slice_reverse_3:5:-1",
|
529 |
+
"amount": 181
|
530 |
+
},
|
531 |
+
{
|
532 |
+
"name": "slice_3:5",
|
533 |
+
"amount": 181
|
534 |
+
},
|
535 |
+
{
|
536 |
+
"name": "slice_reverse_3:6:-1",
|
537 |
+
"amount": 181
|
538 |
+
},
|
539 |
+
{
|
540 |
+
"name": "slice_3:6",
|
541 |
+
"amount": 181
|
542 |
+
},
|
543 |
+
{
|
544 |
+
"name": "char_at_4",
|
545 |
+
"amount": 181
|
546 |
+
},
|
547 |
+
{
|
548 |
+
"name": "slice_reverse_4:6:-1",
|
549 |
+
"amount": 181
|
550 |
+
},
|
551 |
+
{
|
552 |
+
"name": "slice_4:6",
|
553 |
+
"amount": 181
|
554 |
+
},
|
555 |
+
{
|
556 |
+
"name": "slice_reverse_4:7:-1",
|
557 |
+
"amount": 181
|
558 |
+
},
|
559 |
+
{
|
560 |
+
"name": "slice_4:7",
|
561 |
+
"amount": 181
|
562 |
+
}
|
563 |
+
]
|
564 |
+
},
|
565 |
+
{
|
566 |
+
"length": 15,
|
567 |
+
"files": [
|
568 |
+
"stop_15_test.json"
|
569 |
+
],
|
570 |
+
"entries": 4887,
|
571 |
+
"groups": [
|
572 |
+
{
|
573 |
+
"name": "step_::-1",
|
574 |
+
"amount": 181
|
575 |
+
},
|
576 |
+
{
|
577 |
+
"name": "step_::1",
|
578 |
+
"amount": 181
|
579 |
+
},
|
580 |
+
{
|
581 |
+
"name": "char_at_0",
|
582 |
+
"amount": 181
|
583 |
+
},
|
584 |
+
{
|
585 |
+
"name": "slice_reverse_0:2:-1",
|
586 |
+
"amount": 181
|
587 |
+
},
|
588 |
+
{
|
589 |
+
"name": "slice_0:2",
|
590 |
+
"amount": 181
|
591 |
+
},
|
592 |
+
{
|
593 |
+
"name": "slice_reverse_0:3:-1",
|
594 |
+
"amount": 181
|
595 |
+
},
|
596 |
+
{
|
597 |
+
"name": "slice_0:3",
|
598 |
+
"amount": 181
|
599 |
+
},
|
600 |
+
{
|
601 |
+
"name": "char_at_1",
|
602 |
+
"amount": 181
|
603 |
+
},
|
604 |
+
{
|
605 |
+
"name": "slice_reverse_1:3:-1",
|
606 |
+
"amount": 181
|
607 |
+
},
|
608 |
+
{
|
609 |
+
"name": "slice_1:3",
|
610 |
+
"amount": 181
|
611 |
+
},
|
612 |
+
{
|
613 |
+
"name": "slice_reverse_1:4:-1",
|
614 |
+
"amount": 181
|
615 |
+
},
|
616 |
+
{
|
617 |
+
"name": "slice_1:4",
|
618 |
+
"amount": 181
|
619 |
+
},
|
620 |
+
{
|
621 |
+
"name": "char_at_2",
|
622 |
+
"amount": 181
|
623 |
+
},
|
624 |
+
{
|
625 |
+
"name": "slice_reverse_2:4:-1",
|
626 |
+
"amount": 181
|
627 |
+
},
|
628 |
+
{
|
629 |
+
"name": "slice_2:4",
|
630 |
+
"amount": 181
|
631 |
+
},
|
632 |
+
{
|
633 |
+
"name": "slice_reverse_2:5:-1",
|
634 |
+
"amount": 181
|
635 |
+
},
|
636 |
+
{
|
637 |
+
"name": "slice_2:5",
|
638 |
+
"amount": 181
|
639 |
+
},
|
640 |
+
{
|
641 |
+
"name": "char_at_3",
|
642 |
+
"amount": 181
|
643 |
+
},
|
644 |
+
{
|
645 |
+
"name": "slice_reverse_3:5:-1",
|
646 |
+
"amount": 181
|
647 |
+
},
|
648 |
+
{
|
649 |
+
"name": "slice_3:5",
|
650 |
+
"amount": 181
|
651 |
+
},
|
652 |
+
{
|
653 |
+
"name": "slice_reverse_3:6:-1",
|
654 |
+
"amount": 181
|
655 |
+
},
|
656 |
+
{
|
657 |
+
"name": "slice_3:6",
|
658 |
+
"amount": 181
|
659 |
+
},
|
660 |
+
{
|
661 |
+
"name": "char_at_4",
|
662 |
+
"amount": 181
|
663 |
+
},
|
664 |
+
{
|
665 |
+
"name": "slice_reverse_4:6:-1",
|
666 |
+
"amount": 181
|
667 |
+
},
|
668 |
+
{
|
669 |
+
"name": "slice_4:6",
|
670 |
+
"amount": 181
|
671 |
+
},
|
672 |
+
{
|
673 |
+
"name": "slice_reverse_4:7:-1",
|
674 |
+
"amount": 181
|
675 |
+
},
|
676 |
+
{
|
677 |
+
"name": "slice_4:7",
|
678 |
+
"amount": 181
|
679 |
+
}
|
680 |
+
]
|
681 |
+
},
|
682 |
+
{
|
683 |
+
"length": 20,
|
684 |
+
"files": [
|
685 |
+
"stop_20_test.json"
|
686 |
+
],
|
687 |
+
"entries": 4887,
|
688 |
+
"groups": [
|
689 |
+
{
|
690 |
+
"name": "step_::-1",
|
691 |
+
"amount": 181
|
692 |
+
},
|
693 |
+
{
|
694 |
+
"name": "step_::1",
|
695 |
+
"amount": 181
|
696 |
+
},
|
697 |
+
{
|
698 |
+
"name": "char_at_0",
|
699 |
+
"amount": 181
|
700 |
+
},
|
701 |
+
{
|
702 |
+
"name": "slice_reverse_0:2:-1",
|
703 |
+
"amount": 181
|
704 |
+
},
|
705 |
+
{
|
706 |
+
"name": "slice_0:2",
|
707 |
+
"amount": 181
|
708 |
+
},
|
709 |
+
{
|
710 |
+
"name": "slice_reverse_0:3:-1",
|
711 |
+
"amount": 181
|
712 |
+
},
|
713 |
+
{
|
714 |
+
"name": "slice_0:3",
|
715 |
+
"amount": 181
|
716 |
+
},
|
717 |
+
{
|
718 |
+
"name": "char_at_1",
|
719 |
+
"amount": 181
|
720 |
+
},
|
721 |
+
{
|
722 |
+
"name": "slice_reverse_1:3:-1",
|
723 |
+
"amount": 181
|
724 |
+
},
|
725 |
+
{
|
726 |
+
"name": "slice_1:3",
|
727 |
+
"amount": 181
|
728 |
+
},
|
729 |
+
{
|
730 |
+
"name": "slice_reverse_1:4:-1",
|
731 |
+
"amount": 181
|
732 |
+
},
|
733 |
+
{
|
734 |
+
"name": "slice_1:4",
|
735 |
+
"amount": 181
|
736 |
+
},
|
737 |
+
{
|
738 |
+
"name": "char_at_2",
|
739 |
+
"amount": 181
|
740 |
+
},
|
741 |
+
{
|
742 |
+
"name": "slice_reverse_2:4:-1",
|
743 |
+
"amount": 181
|
744 |
+
},
|
745 |
+
{
|
746 |
+
"name": "slice_2:4",
|
747 |
+
"amount": 181
|
748 |
+
},
|
749 |
+
{
|
750 |
+
"name": "slice_reverse_2:5:-1",
|
751 |
+
"amount": 181
|
752 |
+
},
|
753 |
+
{
|
754 |
+
"name": "slice_2:5",
|
755 |
+
"amount": 181
|
756 |
+
},
|
757 |
+
{
|
758 |
+
"name": "char_at_3",
|
759 |
+
"amount": 181
|
760 |
+
},
|
761 |
+
{
|
762 |
+
"name": "slice_reverse_3:5:-1",
|
763 |
+
"amount": 181
|
764 |
+
},
|
765 |
+
{
|
766 |
+
"name": "slice_3:5",
|
767 |
+
"amount": 181
|
768 |
+
},
|
769 |
+
{
|
770 |
+
"name": "slice_reverse_3:6:-1",
|
771 |
+
"amount": 181
|
772 |
+
},
|
773 |
+
{
|
774 |
+
"name": "slice_3:6",
|
775 |
+
"amount": 181
|
776 |
+
},
|
777 |
+
{
|
778 |
+
"name": "char_at_4",
|
779 |
+
"amount": 181
|
780 |
+
},
|
781 |
+
{
|
782 |
+
"name": "slice_reverse_4:6:-1",
|
783 |
+
"amount": 181
|
784 |
+
},
|
785 |
+
{
|
786 |
+
"name": "slice_4:6",
|
787 |
+
"amount": 181
|
788 |
+
},
|
789 |
+
{
|
790 |
+
"name": "slice_reverse_4:7:-1",
|
791 |
+
"amount": 181
|
792 |
+
},
|
793 |
+
{
|
794 |
+
"name": "slice_4:7",
|
795 |
+
"amount": 181
|
796 |
+
}
|
797 |
+
]
|
798 |
+
}
|
799 |
+
]
|
800 |
+
},
|
801 |
+
"length": 20,
|
802 |
+
"set": "train",
|
803 |
+
"items": {
|
804 |
+
"train": 33939,
|
805 |
+
"test": 14661
|
806 |
+
}
|
807 |
+
}
|
small/stop_10_test.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:80c538fc58645fe384222da0679943a9395695429dea6eb2c5ed760f5b2073db
|
3 |
+
size 81715
|
small/stop_10_train.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bb1b3b3f64e31f25c401e9582a65b77beeace02f951627952ca15e0a29355aac
|
3 |
+
size 230704
|
small/stop_15_test.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0c420cda9e2c43cfe6203d0d84d2a45c4443ba80b6a4e52e6692bdfbf01bb9e5
|
3 |
+
size 111453
|
small/stop_15_train.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:89c4f37b5e5d9fb7e78b199d11e1526a329b41a0095f67b6f2df04f6d7f7c8d4
|
3 |
+
size 281967
|
small/stop_20_test.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:978b1dc0fe762b12c5de288167ac9e6da74c91b9c7f0f78c27cc15a3abc62002
|
3 |
+
size 143010
|
small/stop_20_train.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6c60391132629154137a68e8b40b0d919960265f9ef0ac87b5272e3babc9329e
|
3 |
+
size 329405
|
usage.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import datasets
|
2 |
+
|
3 |
+
if __name__=="__main__":
|
4 |
+
# load locally from this repo
|
5 |
+
ds = datasets.load_dataset("./stop.py", "small")
|
6 |
+
|
7 |
+
ds.push_to_hub("PaDaS-Lab/stop-small")
|
8 |
+
|
9 |
+
from datasets import load_dataset
|
10 |
+
|
11 |
+
dataset = load_dataset("PaDaS-Lab/stop-small")
|
12 |
+
print(dataset)
|
13 |
+
|
14 |
+
# load locally from this repo
|
15 |
+
# load locally from this repo
|
16 |
+
|