Browse Source

Enable to delete relation if one of the entities are deleted

pull/1570/head
Hironsan 2 years ago
parent
commit
649380f076
1 changed files with 5 additions and 0 deletions
  1. 5
      frontend/pages/demo/named-entity-recognition/index.vue

5
frontend/pages/demo/named-entity-recognition/index.vue

@ -170,6 +170,11 @@ export default {
methods: {
deleteEntity(annotationId) {
this.currentDoc.annotations = this.currentDoc.annotations.filter(item => item.id !== annotationId)
this.relations.forEach((r) => {
if (r.fromId === annotationId || r.toId === annotationId) {
this.deleteRelation(r.id)
}
})
},
updateEntity(annotationId, labelId) {
const index = this.currentDoc.annotations.findIndex(item => item.id === annotationId)

Loading…
Cancel
Save