8000 fix elmo examples · flypythoncom/ner-bert@92d1f3f · GitHub
[go: up one dir, main page]

Skip to content

Commit 92d1f3f

Browse files
author
Ubuntu
committed
fix elmo examples
1 parent c08a105 commit 92d1f3f

File tree

3 files changed

+1789
-200
lines changed

3 files changed

+1789
-200
lines changed

examples_elmo/factrueval-nmt.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,11 @@
234234
}
235235
],
236236
"source": [
237+
"num_epochs = 100\n",
237238
"learner = NerLearner(model, data,\n",
238239
" best_model_path=\"/datadrive/models/factrueval/elmo_attn_nmt.cpt\",\n",
239-
" base_lr=0.001, lr_max=0.005, clip=5.0, use_lr_scheduler=False, sup_labels=data.id2label[4:])"
240+
" lr=0.01, clip=1.0, sup_labels=data.id2label[4:],\n",
241+
" t_total=num_epochs * len(data.train_dl))"
240242
]
241243
},
242244
{
@@ -255,7 +257,7 @@
255257
},
256258
"outputs": [],
257259
"source": [
258-
"learner.fit(100, target_metric='prec')"
260+
"learner.fit(num_epochs, target_metric='prec')"
259261
]
260262
},
261263
{

examples_elmo/factrueval.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,11 @@
238238
}
239239
],
240240
"source": [
241+
"num_epochs = 100\n",
241242
"learner = NerLearner(model, data,\n",
242243
" best_model_path=\"/datadrive/models/factrueval/elmo_attn_cased.cpt\",\n",
243-
" base_lr=0.0001, lr_max=0.005, clip=5.0, use_lr_scheduler=True, sup_labels=data.id2label[4:])"
244+
" lr=0.01, clip=1.0, sup_labels=data.id2label[4:],\n",
245+
" t_total=num_epochs * len(data.train_dl))"
244246
]
245247
},
246248
{
@@ -347,7 +349,7 @@
347349
}
348350
],
349351
"source": [
350-
"learner.fit(1, target_metric='prec')"
352+
"learner.fit(num_epochs, target_metric='f1')"
351353
]
352354
},
353355
{

0 commit comments

Comments
 (0)
0