簡體   English   中英

從 Prodigy 的用於標記 NER 的 JSONL 格式轉換為 spaCy 的訓練格式?

[英]Convert from Prodigy's JSONL format for labeled NER to spaCy's training format?

我是 Prodigy 和 spaCy 以及 CLI 編碼的新手。 我想使用 Prodigy 來 label 我的 NER model 數據,然后在 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)]}),
]

如何從一種轉換為另一種? 看起來這應該很容易,但我在任何地方都找不到。

我在數據集中加載沒有問題,只是轉換。

從 1.9 版開始,Prodigy 應使用data-to-spacy導出此訓練格式: https://prodi.gy/docs/recipes#data-to-spacy

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM