【问题标题】:To know the output directory of the module了解模块的输出目录
【发布时间】:2018-04-10 05:10:45
【问题描述】:

我对python编程和spacy模块非常陌生,在这里我创建了自己的命名实体识别模块,它工作正常,但我想知道模块在输出目录中的保存位置,请帮助我

将模型保存到输出目录

if output_dir is not None:
    output_dir = Path(output_dir)
    if not output_dir.exists():
        output_dir.mkdir()
    nlp.meta['name'] = new_model_name  #rename model
    nlp.to_disk(output_dir)
    print("Saved model to", output_dir)

    # test the saved model
    print("Loading from", output_dir)
    nlp2 = spacy.load(output_dir)
    doc2 = nlp2(test_text)
    for ent in doc2.ents:
        print(ent.label_, ent.text)

【问题讨论】:

  • 模块保存在您保存的任何位置。你的问题没有意义。请尝试改写它。

标签: python machine-learning spacy


【解决方案1】:

我猜你想知道你的训练模型保存到哪个目录。您的代码中甚至还有变量 output_dir。只需查看它设置的值并在您的文件系统中找到它。如果这不是您面临的问题,请澄清您的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-25
    相关资源
    最近更新 更多