Skip to content

Commit

Permalink
add v2 config
Browse files Browse the repository at this point in the history
  • Loading branch information
svlandeg committed Jan 16, 2024
1 parent 83fb5e4 commit c5d81bc
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 1 deletion.
File renamed without changes.
147 changes: 147 additions & 0 deletions tutorials/nel_emerson/configs/nel_v2.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
[paths]
train = ""
dev = ""
raw = null
init_tok2vec = null
kb = ""
base_nlp = "temp/my_nlp"
vectors = "${paths.base_nlp}"

[system]
seed = 342
gpu_allocator = null

[nlp]
lang = "en"
pipeline = ["sentencizer","entity_ruler","ner","entity_linker"]
disabled = []
before_creation = null
after_creation = null
after_pipeline_creation = null
tokenizer = {"@tokenizers":"spacy.Tokenizer.v1"}

[components]

[components.sentencizer]
factory = "sentencizer"
punct_chars = null

[components.entity_ruler]
source = "${paths.base_nlp}"
component = "entity_ruler"

[components.ner]
source = "${paths.base_nlp}"
component = "ner"

[components.entity_linker]
factory = "entity_linker"
entity_vector_length = 64
generate_empty_kb = {"@misc":"spacy.EmptyKB.v2"}
get_candidates = {"@misc":"spacy.CandidateGenerator.v1"}
get_candidates_batch = {"@misc":"spacy.CandidateBatchGenerator.v1"}
incl_context = true
incl_prior = true
labels_discard = []

[components.entity_linker.model]
@architectures = "spacy.EntityLinker.v2"
nO = null

[components.entity_linker.model.tok2vec]
@architectures = "spacy.HashEmbedCNN.v2"
pretrained_vectors = null
width = 96
depth = 4
embed_size = 2000
window_size = 1
maxout_pieces = 3
subword_features = true

[initialize]
vectors = ${paths.vectors}
init_tok2vec = ${paths.init_tok2vec}
vocab_data = null
lookups = null

[initialize.components]

[initialize.components.entity_linker]

[initialize.components.entity_linker.kb_loader]
@misc = "spacy.KBFromFile.v1"
kb_path = ${paths.kb}

[initialize.tokenizer]


[corpora]

[corpora.train]
@readers = "MyCorpus.v1"
file = ${paths.train}

[corpora.dev]
@readers = "MyCorpus.v1"
file = ${paths.dev}

[training]
train_corpus = "corpora.train"
dev_corpus = "corpora.dev"
seed = ${system.seed}
gpu_allocator = ${system.gpu_allocator}
dropout = 0.2
patience = 10000
eval_frequency = 200
accumulate_gradient = 2
max_epochs = 0
max_steps = 600
frozen_components = ["sentencizer","ner"]
before_to_disk = null

[training.logger]
@loggers = "spacy.ConsoleLogger.v1"
progress_bar = false


[training.batcher]
@batchers = "spacy.batch_by_words.v1"
discard_oversize = false
tolerance = 0.2
get_length = null

[training.batcher.size]
@schedules = "compounding.v1"
start = 100
stop = 1000
compound = 1.001
t = 0.0

[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 = 0.00000001
learn_rate = 0.001

[training.score_weights]
nel_micro_p = 0.0
nel_micro_r = 0.0
nel_micro_f = 1.0

[pretraining]

[optimizer]
@optimizers = "Adam.v1"
learn_rate = 0.001
beta1 = 0.9
beta2 = 0.999
L2 = 0.0
eps = 0.00000001
grad_clip = 1.0
L2_is_weight_decay = true
use_averages = true
2 changes: 1 addition & 1 deletion tutorials/nel_emerson/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: "**This project was created as part of a [step-by-step video tutori
# Variables can be referenced across the project.yml using ${vars.var_name}
vars:
name: "nel_emerson"
config: "nel.cfg"
config: "nel_v2.cfg"
vectors_model: "en_core_web_md"
annotations: "emerson_annotated_text.jsonl"
entities: "entities.csv"
Expand Down

0 comments on commit c5d81bc

Please sign in to comment.