quire-grammar-model 0.2.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.
- quire_grammar_model-0.2.0/PKG-INFO +44 -0
- quire_grammar_model-0.2.0/README.md +34 -0
- quire_grammar_model-0.2.0/pyproject.toml +27 -0
- quire_grammar_model-0.2.0/setup.cfg +4 -0
- quire_grammar_model-0.2.0/src/quire_grammar_model/__init__.py +33 -0
- quire_grammar_model-0.2.0/src/quire_grammar_model/py.typed +0 -0
- quire_grammar_model-0.2.0/src/quire_grammar_model/tag_vocab.json +611 -0
- quire_grammar_model-0.2.0/src/quire_grammar_model/tagger.onnx +0 -0
- quire_grammar_model-0.2.0/src/quire_grammar_model/tokenizer.json +29151 -0
- quire_grammar_model-0.2.0/src/quire_grammar_model.egg-info/PKG-INFO +44 -0
- quire_grammar_model-0.2.0/src/quire_grammar_model.egg-info/SOURCES.txt +11 -0
- quire_grammar_model-0.2.0/src/quire_grammar_model.egg-info/dependency_links.txt +1 -0
- quire_grammar_model-0.2.0/src/quire_grammar_model.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quire-grammar-model
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Bundled phase-2 edit-tagger for quire-grammar (data only, no code).
|
|
5
|
+
Author: Roger Cooper
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/jutreuter/quire-grammar
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# quire-grammar-model
|
|
12
|
+
|
|
13
|
+
The bundled phase-2 edit-tagger for
|
|
14
|
+
[quire-grammar](https://github.com/jutreuter/quire-grammar) — **data only, no
|
|
15
|
+
code**.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
pip install quire-grammar[model] # pulls this + onnxruntime + tokenizers
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`quire_grammar.check()` runs rules-only without it and activates the model
|
|
22
|
+
when it's present — "off if missing", like a spell dictionary.
|
|
23
|
+
|
|
24
|
+
## What's inside
|
|
25
|
+
|
|
26
|
+
| file | what |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `tagger.onnx` | GECToR-style token tagger, int8, ~66 MB |
|
|
29
|
+
| `tokenizer.json` | the matching `tokenizers` (WordPiece) definition |
|
|
30
|
+
| `tag_vocab.json` | the edit-tag label list |
|
|
31
|
+
|
|
32
|
+
`quire_grammar_model.path()` returns the directory; `available()` says whether
|
|
33
|
+
every file is present.
|
|
34
|
+
|
|
35
|
+
## Provenance
|
|
36
|
+
|
|
37
|
+
Fine-tuned from `distilbert-base-cased` (Apache-2.0; pretrained on Wikipedia +
|
|
38
|
+
BooksCorpus) on synthetic native-writer errors injected over public-domain
|
|
39
|
+
prose (Project Gutenberg). No non-commercial or research-only corpus is in the
|
|
40
|
+
training set. Licensed **Apache-2.0**.
|
|
41
|
+
|
|
42
|
+
The model file is regenerated from the training pipeline in the main repo
|
|
43
|
+
(`train/` → `train.export --out-dir packages/quire-grammar-model/src/quire_grammar_model/`),
|
|
44
|
+
not edited by hand.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# quire-grammar-model
|
|
2
|
+
|
|
3
|
+
The bundled phase-2 edit-tagger for
|
|
4
|
+
[quire-grammar](https://github.com/jutreuter/quire-grammar) — **data only, no
|
|
5
|
+
code**.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
pip install quire-grammar[model] # pulls this + onnxruntime + tokenizers
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`quire_grammar.check()` runs rules-only without it and activates the model
|
|
12
|
+
when it's present — "off if missing", like a spell dictionary.
|
|
13
|
+
|
|
14
|
+
## What's inside
|
|
15
|
+
|
|
16
|
+
| file | what |
|
|
17
|
+
|---|---|
|
|
18
|
+
| `tagger.onnx` | GECToR-style token tagger, int8, ~66 MB |
|
|
19
|
+
| `tokenizer.json` | the matching `tokenizers` (WordPiece) definition |
|
|
20
|
+
| `tag_vocab.json` | the edit-tag label list |
|
|
21
|
+
|
|
22
|
+
`quire_grammar_model.path()` returns the directory; `available()` says whether
|
|
23
|
+
every file is present.
|
|
24
|
+
|
|
25
|
+
## Provenance
|
|
26
|
+
|
|
27
|
+
Fine-tuned from `distilbert-base-cased` (Apache-2.0; pretrained on Wikipedia +
|
|
28
|
+
BooksCorpus) on synthetic native-writer errors injected over public-domain
|
|
29
|
+
prose (Project Gutenberg). No non-commercial or research-only corpus is in the
|
|
30
|
+
training set. Licensed **Apache-2.0**.
|
|
31
|
+
|
|
32
|
+
The model file is regenerated from the training pipeline in the main repo
|
|
33
|
+
(`train/` → `train.export --out-dir packages/quire-grammar-model/src/quire_grammar_model/`),
|
|
34
|
+
not edited by hand.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "quire-grammar-model"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Bundled phase-2 edit-tagger for quire-grammar (data only, no code)."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
authors = [{ name = "Roger Cooper" }]
|
|
13
|
+
# Data only. The consumer (`quire-grammar[model]`) brings onnxruntime +
|
|
14
|
+
# tokenizers; this package must stay dependency-free.
|
|
15
|
+
dependencies = []
|
|
16
|
+
|
|
17
|
+
[project.urls]
|
|
18
|
+
Homepage = "https://github.com/jutreuter/quire-grammar"
|
|
19
|
+
|
|
20
|
+
[tool.setuptools]
|
|
21
|
+
package-dir = { "" = "src" }
|
|
22
|
+
|
|
23
|
+
[tool.setuptools.packages.find]
|
|
24
|
+
where = ["src"]
|
|
25
|
+
|
|
26
|
+
[tool.setuptools.package-data]
|
|
27
|
+
quire_grammar_model = ["tagger.onnx", "tokenizer.json", "tag_vocab.json", "py.typed"]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""quire-grammar-model — the bundled phase-2 edit-tagger, data only.
|
|
2
|
+
|
|
3
|
+
Install it with the ``quire-grammar[model]`` extra. There is no code here:
|
|
4
|
+
``quire_grammar.model`` locates ``tagger.onnx`` / ``tokenizer.json`` /
|
|
5
|
+
``tag_vocab.json`` through :func:`path`, and runs them with ``onnxruntime`` +
|
|
6
|
+
``tokenizers`` (also pulled by the extra).
|
|
7
|
+
|
|
8
|
+
The model is a GECToR-style token tagger fine-tuned from ``distilbert-base-cased``
|
|
9
|
+
(Apache-2.0) on synthetic errors over public-domain prose — hence the
|
|
10
|
+
Apache-2.0 licence on this package.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from importlib.resources import files
|
|
16
|
+
from importlib.resources.abc import Traversable
|
|
17
|
+
|
|
18
|
+
__version__ = "0.2.0"
|
|
19
|
+
|
|
20
|
+
#: the files that make up a usable model
|
|
21
|
+
FILES: tuple[str, ...] = ("tagger.onnx", "tokenizer.json", "tag_vocab.json")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def path() -> Traversable:
|
|
25
|
+
"""The directory that holds :data:`FILES`."""
|
|
26
|
+
return files(__name__)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def available() -> bool:
|
|
30
|
+
"""True if every file in :data:`FILES` is present (a build may ship the
|
|
31
|
+
package skeleton without the large ``tagger.onnx``)."""
|
|
32
|
+
root = path()
|
|
33
|
+
return all((root / name).is_file() for name in FILES)
|
|
File without changes
|