【问题标题】:Convert from Prodigy's JSONL format for labeled NER to spaCy's training format?从 Prodigy 的用于标记 NER 的 JSONL 格式转换为 spaCy 的训练格式?
【发布时间】:2020-05-21 16:00:05
【问题描述】:

我是 Prodigy 和 spaCy 以及 CLI 编码的新手。我想使用 Prodigy 为 NER 模型标记我的数据,然后在 python 中使用 spaCy 来创建模型。

Prodigy 以 SQLite 格式输出。 SpaCy 采用另一种格式,不知道该怎么称呼它:

TRAIN_DATA = [
    (
        "Horses are too tall and they pretend to care about your feelings",
        {"entities": [(0, 6, LABEL)]},
    ),
    ("Do they bite?", {"entities": []}),
    (
        "horses are too tall and they pretend to care about your feelings",
        {"entities": [(0, 6, LABEL)]},
    ),
    ("horses pretend to care about your feelings", {"entities": [(0, 6, LABEL)]}),
    (
        "they pretend to care about your feelings, those horses",
        {"entities": [(48, 54, LABEL)]},
    ),
    ("horses?", {"entities": [(0, 6, LABEL)]}),
]

如何从一种转换为另一种?看起来这应该很容易,但我在任何地方都找不到。

我在数据集中加载没有问题,只是转换。

【问题讨论】:

    标签: python sqlite nlp spacy named-entity-recognition


    【解决方案1】:

    Prodigy 应使用 data-to-spacy 从 1.9 版导出此培训格式:https://prodi.gy/docs/recipes#data-to-spacy

    【讨论】:

      猜你喜欢
      • 2021-07-30
      • 2018-05-06
      • 1970-01-01
      • 2022-01-02
      • 1970-01-01
      • 1970-01-01
      • 2021-03-13
      • 1970-01-01
      • 2021-04-08
      相关资源
      最近更新 更多