Skip to content

Commit a563bac

Browse files
Merge pull request megagonlabs#173 from megagonlabs/feature/spacy_v3
update configs
2 parents c430e5b + 65c669d commit a563bac

7 files changed

+211
-11
lines changed

config/ja_ginza.analysis.cfg

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
[paths]
2+
train = "corpus/ja_ginza-ud-train.ne.rea.random_sents.spacy"
3+
dev = "corpus/ja_ginza-ud-dev.ne.rea.random_sents.spacy"
4+
vectors = null
5+
init_tok2vec = null
6+
7+
[system]
8+
gpu_allocator = null
9+
seed = 0
10+
11+
[nlp]
12+
lang = "ja"
13+
pipeline = ["tok2vec","parser","attribute_ruler","ner","morphologizer","compound_splitter","bunsetu_recognizer"]
14+
batch_size = 1000
15+
disabled = ["attribute_ruler"]
16+
before_creation = null
17+
after_creation = null
18+
after_pipeline_creation = null
19+
20+
[nlp.tokenizer]
21+
@tokenizers = "spacy.ja.JapaneseTokenizer"
22+
split_mode = "C"
23+
24+
[components]
25+
26+
[components.attribute_ruler]
27+
factory = "attribute_ruler"
28+
validate = false
29+
30+
[components.bunsetu_recognizer]
31+
factory = "bunsetu_recognizer"
32+
remain_bunsetu_suffix = false
33+
34+
[components.compound_splitter]
35+
factory = "compound_splitter"
36+
split_mode = null
37+
38+
[components.morphologizer]
39+
factory = "morphologizer"
40+
41+
[components.morphologizer.model]
42+
@architectures = "spacy.Tagger.v1"
43+
nO = null
44+
45+
[components.morphologizer.model.tok2vec]
46+
@architectures = "spacy.Tok2VecListener.v1"
47+
width = ${components.tok2vec.model.encode.width}
48+
upstream = "*"
49+
50+
[components.ner]
51+
factory = "ner"
52+
incorrect_spans_key = null
53+
moves = null
54+
update_with_oracle_cut_size = 100
55+
56+
[components.ner.model]
57+
@architectures = "spacy.TransitionBasedParser.v2"
58+
state_type = "ner"
59+
extra_state_tokens = false
60+
hidden_width = 64
61+
maxout_pieces = 2
62+
use_upper = true
63+
nO = null
64+
65+
[components.ner.model.tok2vec]
66+
@architectures = "spacy.Tok2VecListener.v1"
67+
width = ${components.tok2vec.model.encode.width}
68+
upstream = "*"
69+
70+
[components.parser]
71+
factory = "parser"
72+
learn_tokens = false
73+
min_action_freq = 30
74+
moves = null
75+
update_with_oracle_cut_size = 100
76+
77+
[components.parser.model]
78+
@architectures = "spacy.TransitionBasedParser.v2"
79+
state_type = "parser"
80+
extra_state_tokens = false
81+
hidden_width = 128
82+
maxout_pieces = 3
83+
use_upper = true
84+
nO = null
85+
86+
[components.parser.model.tok2vec]
87+
@architectures = "spacy.Tok2VecListener.v1"
88+
width = ${components.tok2vec.model.encode.width}
89+
upstream = "*"
90+
91+
[components.tok2vec]
92+
factory = "tok2vec"
93+
94+
[components.tok2vec.model]
95+
@architectures = "spacy.Tok2Vec.v2"
96+
97+
[components.tok2vec.model.embed]
98+
@architectures = "spacy.MultiHashEmbed.v2"
99+
width = ${components.tok2vec.model.encode.width}
100+
attrs = ["ORTH","SHAPE"]
101+
rows = [5000,2500]
102+
include_static_vectors = true
103+
104+
[components.tok2vec.model.encode]
105+
@architectures = "spacy.MaxoutWindowEncoder.v2"
106+
width = 256
107+
depth = 8
108+
window_size = 1
109+
maxout_pieces = 3
110+
111+
[corpora]
112+
113+
[corpora.dev]
114+
@readers = "spacy.Corpus.v1"
115+
path = ${paths.dev}
116+
max_length = 0
117+
gold_preproc = false
118+
limit = 0
119+
augmenter = null
120+
121+
[corpora.train]
122+
@readers = "spacy.Corpus.v1"
123+
path = ${paths.train}
124+
max_length = 2000
125+
gold_preproc = false
126+
limit = 0
127+
augmenter = null
128+
129+
[training]
130+
dev_corpus = "corpora.dev"
131+
train_corpus = "corpora.train"
132+
seed = ${system.seed}
133+
gpu_allocator = ${system.gpu_allocator}
134+
dropout = 0.1
135+
accumulate_gradient = 1
136+
patience = 0
137+
max_epochs = 0
138+
max_steps = 50000
139+
eval_frequency = 200
140+
frozen_components = []
141+
before_to_disk = null
142+
annotating_components = []
143+
144+
[training.batcher]
145+
@batchers = "spacy.batch_by_words.v1"
146+
discard_oversize = false
147+
tolerance = 0.2
148+
get_length = null
149+
150+
[training.batcher.size]
151+
@schedules = "compounding.v1"
152+
start = 100
153+
stop = 1000
154+
compound = 1.001
155+
t = 0.0
156+
157+
[training.logger]
158+
@loggers = "spacy.ConsoleLogger.v1"
159+
progress_bar = false
160+
161+
[training.optimizer]
162+
@optimizers = "Adam.v1"
163+
beta1 = 0.9
164+
beta2 = 0.999
165+
L2_is_weight_decay = true
166+
L2 = 0.01
167+
grad_clip = 1.0
168+
use_averages = false
169+
eps = 0.00000001
170+
learn_rate = 0.001
171+
172+
[training.score_weights]
173+
dep_uas = 0.25
174+
dep_las = 0.25
175+
dep_las_per_type = null
176+
sents_p = null
177+
sents_r = null
178+
sents_f = 0.1
179+
ents_f = 0.25
180+
ents_p = 0.0
181+
ents_r = 0.0
182+
ents_per_type = null
183+
pos_acc = 0.15
184+
morph_acc = 0.0
185+
morph_per_feat = null
186+
tag_acc = 0.0
187+
188+
[pretraining]
189+
190+
[initialize]
191+
vectors = "vectors/"
192+
init_tok2vec = ${paths.init_tok2vec}
193+
vocab_data = null
194+
lookups = null
195+
before_init = null
196+
after_init = null
197+
198+
[initialize.components]
199+
200+
[initialize.tokenizer]

config/ja_ginza.meta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"lang":"ja",
33
"name":"ginza",
4-
"version":"5.0.0a1",
4+
"version":"5.0.0b1",
55
"description":"Japanese multi-task CNN trained on UD-Japanese BCCWJ r2.8 + GSK2014-A(2019). Assigns word2vec token vectors. Components: tok2vec, parser, ner, morphologizer, atteribute_ruler, compound_splitter, bunsetu_recognizer.",
66
"author":"Megagon Labs Tokyo.",
77
"email":"[email protected]",
@@ -55,6 +55,6 @@
5555
"requirements":[
5656
"sudachipy>=0.5.2,<0.6.0",
5757
"sudachidict_core>=20210608",
58-
"ginza>=5.0.0a1,<5.1.0"
58+
"ginza>=5.0.0b1,<5.1.0"
5959
]
6060
}

config/ja_ginza_bert_char_v2_basic.analysis.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ validate = false
2929

3030
[components.bunsetu_recognizer]
3131
factory = "bunsetu_recognizer"
32-
remain_bunsetu_suffix = true
32+
remain_bunsetu_suffix = false
3333

3434
[components.compound_splitter]
3535
factory = "compound_splitter"

config/ja_ginza_bert_char_v2_basic.meta.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"lang":"ja",
33
"name":"ginza_bert_v2",
4-
"version":"5.0.0a1",
4+
"version":"5.0.0b1",
55
"description":"Japanese multi-task CNN trained on UD-Japanese BCCWJ r2.8 + GSK2014-A(2019) + cl-tohoku/bert-base-japanese-char-v2(BasicTokenizer). Components: transformer, parser, atteribute_ruler, ner, morphologizer, compound_splitter, bunsetu_recognizer.",
66
"author":"Megagon Labs Tokyo.",
77
"email":"[email protected]",
@@ -56,7 +56,7 @@
5656
"sudachipy>=0.5.2,<0.6.0",
5757
"sudachidict_core>=20210608",
5858
"sudachitra>=0.1.4,<0.2.0",
59-
"ginza-transformers>=0.2.0,<0.3.0",
60-
"ginza>=5.0.0a1,<5.1.0"
59+
"ginza-transformers>=0.3.0,<1.0.0",
60+
"ginza>=5.0.0b1,<5.1.0"
6161
]
6262
}

config/ja_ginza_bert_v2.analysis.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ validate = false
2929

3030
[components.bunsetu_recognizer]
3131
factory = "bunsetu_recognizer"
32-
remain_bunsetu_suffix = true
32+
remain_bunsetu_suffix = false
3333

3434
[components.compound_splitter]
3535
factory = "compound_splitter"

config/ja_ginza_bert_v2.meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@
5959
"fugashi>=1.1.1",
6060
"unidic-lite>=1.0.8",
6161
"ginza-transformers>=0.3.0,<1.0.0",
62-
"ginza>=5.0.0a1,<5.1.0"
62+
"ginza>=5.0.0b1,<5.1.0"
6363
]
6464
}

config/ja_ginza_electra.meta.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"lang":"ja",
33
"name":"ginza_electra",
4-
"version":"5.0.0a1",
4+
"version":"5.0.0b1",
55
"description":"Japanese multi-task CNN trained on UD-Japanese BCCWJ r2.8 + GSK2014-A(2019) + transformers-ud-japanese-electra--base. Components: transformer, parser, atteribute_ruler, ner, morphologizer, compound_splitter, bunsetu_recognizer.",
66
"author":"Megagon Labs Tokyo.",
77
"email":"[email protected]",
@@ -56,7 +56,7 @@
5656
"sudachipy>=0.5.2,<0.6.0",
5757
"sudachidict_core>=20210608",
5858
"sudachitra>=0.1.4,<0.2.0",
59-
"ginza-transformers>=0.2.0,<0.3.0",
60-
"ginza>=5.0.0a1,<5.1.0"
59+
"ginza-transformers>=0.3.0,<1.0.0",
60+
"ginza>=5.0.0b1,<5.1.0"
6161
]
6262
}

0 commit comments

Comments
 (0)