nlp - 如何在 JSON 中存储令牌信息的自定义属性并用于训练
问题描述
使用gold.docs_to_json,我无法在 JSON 中存储自定义令牌属性
{
"id": 0,
"paragraphs": [
{
"raw": "Complete the nlp task",
"sentences": [
{
"tokens": [
{
"id": 0,
"orth": "Complete",
"tag": "VB",
"head": 0,
"dep": "ROOT",
"ner": "O"
},
{
"id": 1,
"orth": "the",
"tag": "DT",
"head": 2,
"dep": "det",
"ner": "O"
},
{
"id": 2,
"orth": "nlp",
"tag": "NN",
"head": 1,
"dep": "compound",
"ner": "O"
},
{
"id": 3,
"orth": "task",
"tag": "NN",
"head": -3,
"dep": "dobj",
"ner": "O"
}
],
"brackets": []
}
]
}
]
}
我如何也可以存储自定义属性?我也可以用它来训练自定义属性spacy train
。
不相关的细节: 我知道可以制作一个自定义的 doc_to_json 来存储自定义属性,但是如果我无法训练模型来标记自定义属性,那么它就没有用了。
解决方案
推荐阅读
- angular - 在项目中导入lib时如何将角度库称为不同的库名称
- python - Django 查询集 - 查找两个查询集之间的百分比
- sql - 在 SQL Developer 中设置时间范围
- php - 用 withcount 和 orderby 分块巨大的查询
- python - 处理熊猫路径的最佳方法
- node.js - 接吻的消息顺序 - whatsapp
- azure-data-studio - Azure Data Studio - 分离结果窗口
- c# - 无法显示TreeView的所有节点
- python - 使用 numpy.where() 进行矢量化
- python - pandas binning via cut 包括单值(零)bin