+ 调整标注内容传输结构,取消json转义,去除导出中的isSmall

This commit is contained in:
maxmon 2021-06-21 03:26:23 +08:00
parent 81f191f983
commit c9fb7916aa
2 changed files with 7 additions and 4 deletions

View File

@ -1 +1 @@
[{"fileName": "", "annoDetails": "[]", "isAnno": true}, {"fileName": "test2.txt", "annoDetails": "[]", "isAnno": true}, {"fileName": "test4.txt", "annoDetails": "[]", "isAnno": true}, {"fileName": "test1.txt", "annoDetails": "[]", "isAnno": true}, {"fileName": "test10.txt", "annoDetails": "[{\"name\":\"小明\",\"type\":\"person1\",\"start\":0,\"end\":2}]", "isAnno": true}]
[{"fileName": "test1.txt", "annoDetails": [], "isAnno": true}, {"fileName": "test10.txt", "annoDetails": [{"name": "小明", "type": "person1", "start": 0, "end": 2, "isSmall": false}, {"name": "北京工业大学", "type": "organiztion", "start": 5, "end": 11}, {"name": "北京", "type": "location", "start": 5, "end": 7, "isSmall": false}], "isAnno": true}]

View File

@ -268,7 +268,7 @@ export default {
post('/v1/anno/create', {
projectName: that.projectName,
fileName: that.nowFile,
annoDetails: JSON.stringify(that.ners)
annoDetails: that.ners
})
that.$set(that.nersCache, that.nowFile, [...that.ners])
return true
@ -292,7 +292,7 @@ export default {
delete window.isLoadingNowText
// 线
if (!hasCache && info.annoDetails) {
that.$set(that, 'ners', JSON.parse(info.annoDetails))
that.$set(that, 'ners', info.annoDetails)
that.$set(that.nersCache, that.nowFile, [...that.ners])
that.flushWordsType()
}
@ -514,7 +514,10 @@ export default {
for (const fileName in this.nersCache) {
const file = fileName
const text = this.textDic[fileName]
const entity = this.nersCache[fileName]
const entity = JSON.parse(JSON.stringify(this.nersCache[fileName]))
entity.map((item) => {
delete item.isSmall;
})
out.push({ file, text, entity })
}
this.saveTxt(`${Date.now()}.json`, JSON.stringify(out))