因此,每当我试图为SpacyNer加载以前保存的模型时,都会得到一个核心转储。在
if os.path.isfile( model_path ):
ner.model.load( model_path )
for itn in range( 5 ):
random.shuffle( TRAIN_DATA )
for raw_text, entity_offsets in TRAIN_DATA:
doc = nlp.make_doc( raw_text )
gold = GoldParse( doc, entities=entity_offsets )
ner.update( doc, gold ) # <- Core dump occurs here
转储报告:
^{pr2}$我装错了吗?在
嗯。不过,这里可能还有个虫子。显然你应该能够写一个预先加载的模型!在
编辑: 结果我不需要加载模型来更新它,我只需要删除它
再加上
^{pr2}$最后是这样的:
以便它附加到先前保存的数据。一切都好!在
相关问题 更多 >
编程相关推荐