Complete lg tier: fa_dep_news_lg / fa_core_news_lg
Same 200k-row floret table as fa_ent_news_lg, now with dep/core too. - configs/fa_dep_news_lg.cfg (fa_dep_news_md.cfg unchanged except vectors) - project.yml: lg workflow expanded to train-dep-lg, finalize-dep-lg, assemble-core-lg, evaluate-lg, finalize-meta-lg, package-lg, smoke-lg (mirrors the md tier's dep/core commands) - scripts/compare_tiers.py: dep/core UD test groups now 3-way (sm/md/lg) - scripts/finalize_pipeline.py: FLORET_LG url points at the published vectors, https://huggingface.co/Phazel/fa-floret-wiki-vectors UD test: DEP_UAS 90.96 (sm 89.69, md 90.52), DEP_LAS 86.60 (sm 85.15, md 86.34). NER unchanged from the earlier fa_ent_news_lg run, ENTS_F 75.94. docs/MODELS.md §7 rewritten from ent-only to the full tier.
This commit is contained in:
parent
b89b01ceb6
commit
9e8ed06361
|
|
@ -0,0 +1,231 @@
|
|||
# fa_dep_news_lg — tagger, morphologizer, trainable_lemmatizer, parser, WITH the lg-tier
|
||||
# static vectors.
|
||||
#
|
||||
# Byte-identical to configs/fa_dep_news_md.cfg. Only the vector table supplied at train time
|
||||
# via --paths.vectors differs: fa_floret, 200k rows x 300d, floret mode, trained on the full
|
||||
# Persian Wikipedia dump for 5 epochs (assets/vectors/fa_floret_lg), vs md's 50k rows x 300d
|
||||
# trained on 400k Persian documents. Seed, widths, rows, batcher, patience, eval_frequency all
|
||||
# held constant so the delta measures the vector table and nothing else.
|
||||
#
|
||||
# No `ner` here by design; see configs/fa_ner_lg.cfg and project.yml.
|
||||
|
||||
[paths]
|
||||
train = null
|
||||
dev = null
|
||||
vectors = null
|
||||
init_tok2vec = null
|
||||
|
||||
[system]
|
||||
gpu_allocator = null
|
||||
seed = 0
|
||||
|
||||
[nlp]
|
||||
lang = "fa"
|
||||
pipeline = ["tok2vec", "tagger", "morphologizer", "trainable_lemmatizer", "parser"]
|
||||
batch_size = 1000
|
||||
disabled = []
|
||||
before_creation = null
|
||||
after_creation = null
|
||||
after_pipeline_creation = null
|
||||
|
||||
[corpora]
|
||||
|
||||
[training]
|
||||
dev_corpus = "corpora.dev"
|
||||
train_corpus = "corpora.train"
|
||||
seed = ${system.seed}
|
||||
gpu_allocator = ${system.gpu_allocator}
|
||||
dropout = 0.1
|
||||
accumulate_gradient = 1
|
||||
patience = 1600
|
||||
max_epochs = 0
|
||||
max_steps = 20000
|
||||
eval_frequency = 400
|
||||
frozen_components = []
|
||||
annotating_components = []
|
||||
before_to_disk = null
|
||||
before_update = null
|
||||
|
||||
[initialize]
|
||||
vectors = ${paths.vectors}
|
||||
init_tok2vec = ${paths.init_tok2vec}
|
||||
vocab_data = null
|
||||
lookups = null
|
||||
before_init = null
|
||||
after_init = null
|
||||
|
||||
[components]
|
||||
|
||||
[pretraining]
|
||||
|
||||
[nlp.tokenizer]
|
||||
@tokenizers = "spacy.Tokenizer.v1"
|
||||
|
||||
[nlp.vectors]
|
||||
@vectors = "spacy.Vectors.v1"
|
||||
|
||||
[corpora.train]
|
||||
@readers = "spacy.Corpus.v1"
|
||||
path = ${paths.train}
|
||||
max_length = 0
|
||||
gold_preproc = false
|
||||
limit = 0
|
||||
augmenter = null
|
||||
|
||||
[corpora.dev]
|
||||
@readers = "spacy.Corpus.v1"
|
||||
path = ${paths.dev}
|
||||
max_length = 0
|
||||
gold_preproc = false
|
||||
limit = 0
|
||||
augmenter = null
|
||||
|
||||
[training.optimizer]
|
||||
@optimizers = "Adam.v1"
|
||||
beta1 = 0.9
|
||||
beta2 = 0.999
|
||||
L2_is_weight_decay = true
|
||||
L2 = 0.01
|
||||
grad_clip = 1.0
|
||||
use_averages = false
|
||||
eps = 1e-08
|
||||
learn_rate = 0.001
|
||||
|
||||
[training.batcher]
|
||||
@batchers = "spacy.batch_by_words.v1"
|
||||
discard_oversize = false
|
||||
tolerance = 0.2
|
||||
get_length = null
|
||||
|
||||
[training.logger]
|
||||
@loggers = "spacy.ConsoleLogger.v1"
|
||||
progress_bar = false
|
||||
|
||||
[training.score_weights]
|
||||
tag_acc = 0.25
|
||||
pos_acc = 0.12
|
||||
tag_micro_p = null
|
||||
tag_micro_r = null
|
||||
tag_micro_f = null
|
||||
morph_acc = 0.12
|
||||
morph_per_feat = null
|
||||
lemma_acc = 0.25
|
||||
dep_uas = 0.12
|
||||
dep_las = 0.12
|
||||
dep_las_per_type = null
|
||||
sents_p = null
|
||||
sents_r = null
|
||||
sents_f = 0.0
|
||||
|
||||
[initialize.tokenizer]
|
||||
|
||||
[initialize.components]
|
||||
|
||||
[components.tok2vec]
|
||||
factory = "tok2vec"
|
||||
|
||||
[components.tagger]
|
||||
factory = "tagger"
|
||||
label_smoothing = 0.05
|
||||
overwrite = false
|
||||
neg_prefix = "!"
|
||||
|
||||
[components.morphologizer]
|
||||
factory = "morphologizer"
|
||||
label_smoothing = 0.05
|
||||
overwrite = true
|
||||
extend = false
|
||||
|
||||
[components.trainable_lemmatizer]
|
||||
factory = "trainable_lemmatizer"
|
||||
backoff = "orth"
|
||||
min_tree_freq = 3
|
||||
overwrite = false
|
||||
top_k = 1
|
||||
|
||||
[components.parser]
|
||||
factory = "parser"
|
||||
moves = null
|
||||
update_with_oracle_cut_size = 100
|
||||
learn_tokens = false
|
||||
min_action_freq = 30
|
||||
|
||||
[training.batcher.size]
|
||||
@schedules = "compounding.v1"
|
||||
start = 100
|
||||
stop = 1000
|
||||
compound = 1.001
|
||||
t = 0.0
|
||||
|
||||
[components.tok2vec.model]
|
||||
@architectures = "spacy.Tok2Vec.v2"
|
||||
|
||||
[components.tagger.model]
|
||||
@architectures = "spacy.Tagger.v2"
|
||||
nO = null
|
||||
normalize = false
|
||||
|
||||
[components.tagger.scorer]
|
||||
@scorers = "spacy.tagger_scorer.v1"
|
||||
|
||||
[components.morphologizer.model]
|
||||
@architectures = "spacy.Tagger.v2"
|
||||
nO = null
|
||||
normalize = false
|
||||
|
||||
[components.morphologizer.scorer]
|
||||
@scorers = "spacy.morphologizer_scorer.v1"
|
||||
|
||||
[components.trainable_lemmatizer.model]
|
||||
@architectures = "spacy.Tagger.v2"
|
||||
nO = null
|
||||
normalize = false
|
||||
|
||||
[components.trainable_lemmatizer.scorer]
|
||||
@scorers = "spacy.lemmatizer_scorer.v1"
|
||||
|
||||
[components.parser.model]
|
||||
@architectures = "spacy.TransitionBasedParser.v2"
|
||||
state_type = "parser"
|
||||
extra_state_tokens = false
|
||||
hidden_width = 128
|
||||
maxout_pieces = 3
|
||||
use_upper = true
|
||||
nO = null
|
||||
|
||||
[components.parser.scorer]
|
||||
@scorers = "spacy.parser_scorer.v1"
|
||||
|
||||
[components.tok2vec.model.embed]
|
||||
@architectures = "spacy.MultiHashEmbed.v2"
|
||||
width = ${components.tok2vec.model.encode.width}
|
||||
attrs = ["NORM", "PREFIX", "SUFFIX", "SHAPE"]
|
||||
rows = [5000, 1000, 2500, 2500]
|
||||
include_static_vectors = true
|
||||
|
||||
[components.tok2vec.model.encode]
|
||||
@architectures = "spacy.MaxoutWindowEncoder.v2"
|
||||
width = 96
|
||||
depth = 4
|
||||
window_size = 1
|
||||
maxout_pieces = 3
|
||||
|
||||
[components.tagger.model.tok2vec]
|
||||
@architectures = "spacy.Tok2VecListener.v1"
|
||||
width = ${components.tok2vec.model.encode.width}
|
||||
upstream = "*"
|
||||
|
||||
[components.morphologizer.model.tok2vec]
|
||||
@architectures = "spacy.Tok2VecListener.v1"
|
||||
width = ${components.tok2vec.model.encode.width}
|
||||
upstream = "*"
|
||||
|
||||
[components.trainable_lemmatizer.model.tok2vec]
|
||||
@architectures = "spacy.Tok2VecListener.v1"
|
||||
width = ${components.tok2vec.model.encode.width}
|
||||
upstream = "*"
|
||||
|
||||
[components.parser.model.tok2vec]
|
||||
@architectures = "spacy.Tok2VecListener.v1"
|
||||
width = ${components.tok2vec.model.encode.width}
|
||||
upstream = "*"
|
||||
|
|
@ -44,8 +44,9 @@ pipelines such as `de_core_news_sm` as `news`.
|
|||
| `fa_core_web_sm` | same as core, mixed-genre training data | hash embeddings | not built; would add ParsTwiNER to cover social media |
|
||||
| `fa_dep_news_md` | same as `fa_dep_news_sm` | floret, 50k rows / 300d | built, shipping |
|
||||
| `fa_core_news_md` | same as `fa_core_news_sm` | floret, 50k rows / 300d | built, shipping |
|
||||
| `fa_dep_news_lg` | same as `fa_dep_news_sm` | floret, 200k rows / 300d, full-wiki 5 epochs | built, shipping |
|
||||
| `fa_core_news_lg` | same as `fa_core_news_sm` | floret, 200k rows / 300d, full-wiki 5 epochs | built, shipping |
|
||||
| `fa_ent_news_lg` | ner (own internal tok2vec) | floret, 200k rows / 300d, full-wiki 5 epochs | built, optional |
|
||||
| `fa_core_news_lg` | same | floret, 200k rows | not built; bigger table, same recipe as md |
|
||||
| `fa_core_news_trf` | transformer instead of tok2vec | `HooshvareLab/roberta-fa-zwnj-base` (Apache-2.0) | not on this hardware; 2 GB VRAM cannot fine-tune a 125M-param encoder |
|
||||
|
||||
### Why `core` is honest here
|
||||
|
|
@ -351,26 +352,43 @@ Whether that trade is worth it depends on deployment. For a 1.19 LAS and 2.85 NE
|
|||
9x larger download and 16% slower parse is a good deal on a server and a bad one in a browser
|
||||
or a Lambda cold start. Both tiers ship; pick per target.
|
||||
|
||||
## 7. The `lg` tier: bigger floret table, `ent` only
|
||||
## 7. The `lg` tier: bigger floret table, full pipeline
|
||||
|
||||
Built after `md`, from a new `fa_floret` table — 200,000 rows x 300d, floret mode,
|
||||
`minn=maxn=5`, `hash_count=2`, trained on the full Persian Wikipedia dump for 5 epochs (4x
|
||||
the rows of `md`'s 50k-row table trained on 400k documents). Unpacked the same way as `md`
|
||||
via `scripts/unpack_vectors.py`, into `assets/vectors/fa_floret_lg`.
|
||||
the rows of `md`'s 50k-row table trained on 400k documents). Raw `.floret`/`.vec` and the
|
||||
packaged spaCy wheel are at <https://huggingface.co/Phazel/fa-floret-wiki-vectors>. Unpacked
|
||||
the same way as `md` via `scripts/unpack_vectors.py`, into `assets/vectors/fa_floret_lg`.
|
||||
|
||||
`configs/fa_ner_lg.cfg` is `fa_ner_md.cfg` unchanged except `--paths.vectors`. Only `ent` was
|
||||
trained at this tier (`fa_ent_news_lg`), not `dep`/`core`: the point of this run was to check
|
||||
whether a 4x larger table is worth it before spending the CPU time on `dep`/`core` too. Same
|
||||
seed, same corpus, same architecture as `sm`/`md`. Reproduce with `spacy project run ent-lg`,
|
||||
or the table alone with `python scripts/compare_tiers.py`.
|
||||
`configs/fa_ner_lg.cfg` and `configs/fa_dep_news_lg.cfg` are `fa_ner_md.cfg`/
|
||||
`fa_dep_news_md.cfg` unchanged except `--paths.vectors`. Same seed, same corpus, same
|
||||
architecture as `sm`/`md` throughout, so the deltas below are attributable to the vector
|
||||
table alone. Reproduce with `spacy project run lg`, or the tables alone with
|
||||
`python scripts/compare_tiers.py`.
|
||||
|
||||
### PerDT NER test split, `fa_ent_news_lg`
|
||||
### UD test split, `fa_dep_news_lg` / `fa_core_news_lg`
|
||||
|
||||
| Metric | `sm` | `md` | `lg` | Delta (lg vs sm) |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `ENTS_P` | 77.67 | 76.56 | 81.51 | +3.84 |
|
||||
| `ENTS_R` | 66.87 | 72.95 | 71.09 | +4.22 |
|
||||
| `ENTS_F` | 71.87 | 74.71 | 75.94 | +4.08 |
|
||||
| Metric | `sm` | `md` | `lg` | Delta (lg vs sm) | Delta (lg vs md) |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| `TAG_ACC` | 95.96 | 96.25 | 96.55 | +0.59 | +0.30 |
|
||||
| `POS_ACC` | 96.24 | 96.64 | 96.68 | +0.44 | +0.04 |
|
||||
| `MORPH_ACC` | 96.29 | 96.64 | 96.70 | +0.41 | +0.06 |
|
||||
| `LEMMA_ACC` | 97.91 | 97.96 | 98.08 | +0.17 | +0.12 |
|
||||
| `DEP_UAS` | 89.69 | 90.52 | 90.96 | +1.27 | +0.44 |
|
||||
| `DEP_LAS` | 85.15 | 86.34 | 86.60 | +1.45 | +0.26 |
|
||||
|
||||
`lg` beats `md` on every UD metric, same monotonic pattern as `md` beating `sm` in §6 — a
|
||||
bigger, less collision-prone floret table keeps paying off, though the `md`-to-`lg` gains
|
||||
(4x the vector rows) are smaller than the `sm`-to-`md` gains (going from none to 50k rows):
|
||||
diminishing returns, as expected.
|
||||
|
||||
### PerDT NER test split, `fa_ent_news_lg` (identical `ner` component embedded in `fa_core_news_lg`)
|
||||
|
||||
| Metric | `sm` | `md` | `lg` | Delta (lg vs sm) | Delta (lg vs md) |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| `ENTS_P` | 77.67 | 76.56 | 81.51 | +3.84 | +4.95 |
|
||||
| `ENTS_R` | 66.87 | 72.95 | 71.09 | +4.22 | -1.86 |
|
||||
| `ENTS_F` | 71.87 | 74.71 | 75.94 | +4.08 | +1.23 |
|
||||
|
||||
`lg` beats both `sm` and `md` on `ENTS_F`, and unlike `md`'s recall-only gain over `sm`, `lg`
|
||||
improves precision too (+3.84 over `sm`, whereas `md` cost -1.10). Consistent with a bigger,
|
||||
|
|
@ -393,16 +411,23 @@ one-or-two-entity noise, same caveat as §6.
|
|||
|
||||
### Cost
|
||||
|
||||
The bigger table dominates the artifact even more than `md`'s did: `fa_ent_news_lg` is a
|
||||
217 MB wheel against 5.6 MB for `sm` and 58 MB for `md` — the 200k x 300d float32 vector
|
||||
table alone is ~240 MB uncompressed. Training cost was comparable to `sm`/`md` (early stop
|
||||
at step 7,200 of 20,000, best checkpoint at step 5,600). The `spacy benchmark accuracy`
|
||||
words/s figures swung in `lg`'s favor in this run (15,614 vs 8,500 `sm` / 7,149 `md`); given
|
||||
`lg`'s tok2vec architecture is identical to `md`'s and only the static-vector table lookup
|
||||
differs, treat that as single-run CPU contention noise on shared hardware, not a real
|
||||
architectural speedup, and re-benchmark before citing a number.
|
||||
The bigger table dominates the artifact even more than `md`'s did: the 200k x 300d float32
|
||||
vector table is ~240 MB uncompressed, so `fa_dep_news_lg` is a 219 MB wheel (vs 7.5 MB `sm`,
|
||||
60 MB `md`), `fa_core_news_lg` 225 MB (vs 13 MB `sm`, 66 MB `md`), and `fa_ent_news_lg` alone
|
||||
217 MB (vs 5.6 MB `sm`, 58 MB `md`). Training cost roughly doubled `md`'s: `dep_lg` ran to
|
||||
early stop at step 12,000 of 20,000 over ~2h08m CPU wall time (vs `dep_md`'s single-digit
|
||||
minutes territory implied by its architecture-identical config — `lg`'s extra time is
|
||||
entirely the larger embedding table's per-step cost, not more steps). `ner_lg` early-stopped
|
||||
at step 7,200, ~13 min, in line with `sm`/`md`.
|
||||
|
||||
For a 4x download over `md` (and 39x over `sm`) buying +4.08 ENTS_F over `sm` (+1.23 over
|
||||
`md`), `lg` is a server/offline-batch pipeline, not something to ship to a browser or a
|
||||
cold-start function. `dep`/`core` at this tier are not yet built; the `ent`-only result above
|
||||
is the signal for whether that investment is worth making.
|
||||
`words/s` from `spacy benchmark accuracy` were noisier at this tier than `sm`-vs-`md`: dep/core
|
||||
throughput dropped as expected (9,387 / 6,655 words/s vs `sm`'s 12,505 / 8,834, `md`'s
|
||||
10,493 / 7,269 — the larger table costs real lookup time), but the standalone `ent_lg` run
|
||||
showed 15,614 words/s, higher than `sm`/`md`'s ent runs despite an identical `ner`
|
||||
architecture and the same larger table. Treat that one figure as single-run CPU contention
|
||||
noise on shared hardware, not a real speedup, and re-benchmark before citing it.
|
||||
|
||||
For a 4x download over `md` (and up to 39x over `sm`) buying +1.45 DEP_LAS / +1.23 ENTS_F
|
||||
over `md` (+1.45 DEP_LAS / +4.08 ENTS_F over `sm`), `lg` is a server/offline-batch pipeline,
|
||||
not something to ship to a browser or a cold-start function. All three variants — `dep`,
|
||||
`ent`, `core` — are built and evaluated at this tier, same as `md`.
|
||||
|
|
|
|||
107
project.yml
107
project.yml
|
|
@ -34,10 +34,11 @@ vars:
|
|||
core_md_package_name: "core_news_md"
|
||||
floret_wheel: "fa_floret-0.1.0-py3-none-any-400k-documents.whl"
|
||||
vectors_dir: "assets/vectors/fa_floret_400k"
|
||||
# lg tier. Same architecture as sm/md, but ner only (no dep/core trained yet), with a
|
||||
# larger floret table: 200k rows x 300d, trained on the full Persian Wikipedia dump for
|
||||
# 5 epochs (vs md's 50k rows / 400k documents).
|
||||
# lg tier: same architecture as sm/md, larger floret table (200k rows x 300d, trained on
|
||||
# the full Persian Wikipedia dump for 5 epochs, vs md's 50k rows / 400k documents).
|
||||
ent_lg_package_name: "ent_news_lg"
|
||||
dep_lg_package_name: "dep_news_lg"
|
||||
core_lg_package_name: "core_news_lg"
|
||||
floret_lg_wheel: "fa_floret-0.1.0-py3-none-any-full-wiki-200k-5epoch.whl"
|
||||
vectors_lg_dir: "assets/vectors/fa_floret_lg"
|
||||
|
||||
|
|
@ -99,16 +100,19 @@ workflows:
|
|||
- finalize-ent
|
||||
- evaluate-ent
|
||||
- package-ent
|
||||
# The lg tier: ner only, same corpus as sm/md, with a bigger floret table (200k rows,
|
||||
# full Persian Wikipedia, 5 epochs) than md's (50k rows, 400k documents).
|
||||
ent-lg:
|
||||
# The lg tier: same corpus and architecture as sm/md, with a bigger floret table (200k
|
||||
# rows, full Persian Wikipedia, 5 epochs) than md's (50k rows, 400k documents).
|
||||
lg:
|
||||
- vectors-lg
|
||||
- train-dep-lg
|
||||
- train-ner-lg
|
||||
- finalize-ent-lg
|
||||
- evaluate-ent-lg
|
||||
- finalize-dep-lg
|
||||
- assemble-core-lg
|
||||
- evaluate-lg
|
||||
- finalize-meta-lg
|
||||
- compare-lg
|
||||
- package-ent-lg
|
||||
- smoke-ent-lg
|
||||
- package-lg
|
||||
- smoke-lg
|
||||
# The md tier: same corpus and architecture, plus the fa_floret static vectors.
|
||||
md:
|
||||
- vectors-md
|
||||
|
|
@ -345,6 +349,18 @@ commands:
|
|||
outputs:
|
||||
- "${vars.vectors_lg_dir}"
|
||||
|
||||
- name: "train-dep-lg"
|
||||
help: "Train the dep pipeline with the lg-tier static floret vectors"
|
||||
script:
|
||||
- "python -m spacy train configs/fa_dep_news_lg.cfg --output training/dep-lg --paths.train corpus/merged/${vars.treebank}-ud-train.spacy --paths.dev corpus/merged/${vars.treebank}-ud-dev.spacy --paths.vectors ${vars.vectors_lg_dir} --gpu-id ${vars.gpu}"
|
||||
deps:
|
||||
- "corpus/merged/${vars.treebank}-ud-train.spacy"
|
||||
- "corpus/merged/${vars.treebank}-ud-dev.spacy"
|
||||
- "configs/fa_dep_news_lg.cfg"
|
||||
- "${vars.vectors_lg_dir}"
|
||||
outputs:
|
||||
- "training/dep-lg/model-best"
|
||||
|
||||
- name: "train-ner-lg"
|
||||
help: "Train the NER component with the lg-tier static floret vectors"
|
||||
script:
|
||||
|
|
@ -367,6 +383,27 @@ commands:
|
|||
outputs:
|
||||
- "training/fa_ent_news_lg"
|
||||
|
||||
- name: "finalize-dep-lg"
|
||||
help: "Write fa_dep_news_lg metadata onto the trained lg model"
|
||||
script:
|
||||
- "python scripts/finalize_pipeline.py training/dep-lg/model-best training/fa_dep_news_lg --variant dep --size lg --version ${vars.package_version}"
|
||||
deps:
|
||||
- "training/dep-lg/model-best"
|
||||
- "scripts/finalize_pipeline.py"
|
||||
outputs:
|
||||
- "training/fa_dep_news_lg"
|
||||
|
||||
- name: "assemble-core-lg"
|
||||
help: "Source the lg ner into the lg dep pipeline to produce fa_core_news_lg"
|
||||
script:
|
||||
- "python scripts/finalize_pipeline.py training/dep-lg/model-best training/fa_core_news_lg --variant core --size lg --version ${vars.package_version} --add-ner training/perdt-ner-lg/model-best"
|
||||
deps:
|
||||
- "training/dep-lg/model-best"
|
||||
- "training/perdt-ner-lg/model-best"
|
||||
- "scripts/finalize_pipeline.py"
|
||||
outputs:
|
||||
- "training/fa_core_news_lg"
|
||||
|
||||
- name: "evaluate-ent-lg"
|
||||
help: "Score fa_ent_news_lg on the held-out PerDT NER test split"
|
||||
script:
|
||||
|
|
@ -378,11 +415,38 @@ commands:
|
|||
outputs:
|
||||
- "metrics/lg-perdt-ner-test.json"
|
||||
|
||||
- name: "evaluate-lg"
|
||||
help: "Score both lg packages (dep, core) on the held-out test splits"
|
||||
script:
|
||||
- "python -m spacy benchmark accuracy training/fa_dep_news_lg corpus/merged/${vars.treebank}-ud-test.spacy --output metrics/lg-ud-test.json --gpu-id ${vars.gpu}"
|
||||
- "python -m spacy benchmark accuracy training/fa_core_news_lg corpus/merged/${vars.treebank}-ud-test.spacy --output metrics/lg-core-ud-test.json --gpu-id ${vars.gpu}"
|
||||
- "python -m spacy benchmark accuracy training/fa_core_news_lg corpus/perdt-ner/test.spacy --output metrics/lg-core-perdt-ner-test.json --gpu-id ${vars.gpu}"
|
||||
deps:
|
||||
- "training/fa_dep_news_lg"
|
||||
- "training/fa_core_news_lg"
|
||||
outputs:
|
||||
- "metrics/lg-ud-test.json"
|
||||
- "metrics/lg-core-ud-test.json"
|
||||
- "metrics/lg-core-perdt-ner-test.json"
|
||||
|
||||
- name: "finalize-meta-lg"
|
||||
help: "Fold the lg test scores into both lg meta.json files"
|
||||
script:
|
||||
- "python scripts/finalize_pipeline.py training/dep-lg/model-best training/fa_dep_news_lg --variant dep --size lg --version ${vars.package_version} --ud-metrics metrics/lg-ud-test.json"
|
||||
- "python scripts/finalize_pipeline.py training/dep-lg/model-best training/fa_core_news_lg --variant core --size lg --version ${vars.package_version} --add-ner training/perdt-ner-lg/model-best --ud-metrics metrics/lg-core-ud-test.json --ner-metrics metrics/lg-core-perdt-ner-test.json"
|
||||
deps:
|
||||
- "metrics/lg-ud-test.json"
|
||||
- "metrics/lg-core-perdt-ner-test.json"
|
||||
- "scripts/finalize_pipeline.py"
|
||||
|
||||
- name: "compare-lg"
|
||||
help: "Table the sm vs md vs lg ent NER deltas from the metrics/ JSON reports"
|
||||
help: "Table the sm vs md vs lg deltas from the metrics/ JSON reports"
|
||||
script:
|
||||
- "python scripts/compare_tiers.py"
|
||||
deps:
|
||||
- "metrics/ud-test.json"
|
||||
- "metrics/md-ud-test.json"
|
||||
- "metrics/lg-ud-test.json"
|
||||
- "metrics/perdt-ner-test.json"
|
||||
- "metrics/md-perdt-ner-test.json"
|
||||
- "metrics/lg-perdt-ner-test.json"
|
||||
|
|
@ -397,6 +461,18 @@ commands:
|
|||
outputs:
|
||||
- "packages/${vars.lang}_${vars.ent_lg_package_name}-${vars.package_version}"
|
||||
|
||||
- name: "package-lg"
|
||||
help: "Build installable wheels + sdists for both lg packages"
|
||||
script:
|
||||
- "python -m spacy package training/fa_dep_news_lg packages --name ${vars.dep_lg_package_name} --version ${vars.package_version} --build sdist,wheel --force"
|
||||
- "python -m spacy package training/fa_core_news_lg packages --name ${vars.core_lg_package_name} --version ${vars.package_version} --build sdist,wheel --force"
|
||||
deps:
|
||||
- "training/fa_dep_news_lg"
|
||||
- "training/fa_core_news_lg"
|
||||
outputs:
|
||||
- "packages/${vars.lang}_${vars.dep_lg_package_name}-${vars.package_version}"
|
||||
- "packages/${vars.lang}_${vars.core_lg_package_name}-${vars.package_version}"
|
||||
|
||||
- name: "smoke-ent-lg"
|
||||
help: "Load fa_ent_news_lg and run it over real Persian text"
|
||||
script:
|
||||
|
|
@ -404,6 +480,15 @@ commands:
|
|||
deps:
|
||||
- "training/fa_ent_news_lg"
|
||||
|
||||
- name: "smoke-lg"
|
||||
help: "Load both lg pipelines and run them over real Persian text"
|
||||
script:
|
||||
- "python scripts/smoke_test.py training/fa_dep_news_lg"
|
||||
- "python scripts/smoke_test.py training/fa_core_news_lg"
|
||||
deps:
|
||||
- "training/fa_dep_news_lg"
|
||||
- "training/fa_core_news_lg"
|
||||
|
||||
# ---------------------------------------------------------------- md tier
|
||||
|
||||
- name: "vectors-md"
|
||||
|
|
|
|||
|
|
@ -18,8 +18,18 @@ from pathlib import Path
|
|||
|
||||
# (label, {tier_label: report_filename})
|
||||
GROUPS = [
|
||||
("dep pipeline, UD test", {"sm": "ud-test.json", "md": "md-ud-test.json"}),
|
||||
("core pipeline, UD test", {"sm": "core-ud-test.json", "md": "md-core-ud-test.json"}),
|
||||
(
|
||||
"dep pipeline, UD test",
|
||||
{"sm": "ud-test.json", "md": "md-ud-test.json", "lg": "lg-ud-test.json"},
|
||||
),
|
||||
(
|
||||
"core pipeline, UD test",
|
||||
{
|
||||
"sm": "core-ud-test.json",
|
||||
"md": "md-core-ud-test.json",
|
||||
"lg": "lg-core-ud-test.json",
|
||||
},
|
||||
),
|
||||
(
|
||||
"ent NER test",
|
||||
{
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ FLORET = {
|
|||
FLORET_LG = {
|
||||
"name": "fa_floret static vectors (lg tier: 200k rows x 300d floret table trained on "
|
||||
"the full Persian Wikipedia dump, 5 epochs, via spacy-vectors-builder)",
|
||||
"url": PROJECT_URL,
|
||||
"url": "https://huggingface.co/Phazel/fa-floret-wiki-vectors",
|
||||
"author": "Kiyarash Fazeli",
|
||||
"license": "CC BY-SA 4.0",
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue