|
|
@ -42,6 +42,7 @@ import ToolbarLaptop from '@/components/tasks/toolbar/ToolbarLaptop' |
|
|
|
import ToolbarMobile from '@/components/tasks/toolbar/ToolbarMobile' |
|
|
|
import AudioViewer from '~/components/tasks/audio/AudioViewer' |
|
|
|
import Seq2seqBox from '~/components/tasks/seq2seq/Seq2seqBox' |
|
|
|
import { TextLabel } from '~/domain/models/tasks/textLabel' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
@ -117,32 +118,35 @@ export default { |
|
|
|
|
|
|
|
methods: { |
|
|
|
async list(itemId) { |
|
|
|
this.annotations = await this.$services.seq2seq.list(this.projectId, itemId) |
|
|
|
this.annotations = await this.$repositories.textLabel.list(this.projectId, itemId) |
|
|
|
}, |
|
|
|
|
|
|
|
async remove(id) { |
|
|
|
await this.$services.seq2seq.delete(this.projectId, this.item.id, id) |
|
|
|
await this.$repositories.textLabel.delete(this.projectId, this.item.id, id) |
|
|
|
await this.list(this.item.id) |
|
|
|
}, |
|
|
|
|
|
|
|
async add(text) { |
|
|
|
await this.$services.seq2seq.create(this.projectId, this.item.id, text) |
|
|
|
const label = TextLabel.create(text) |
|
|
|
await this.$repositories.textLabel.create(this.projectId, this.item.id, label) |
|
|
|
await this.list(this.item.id) |
|
|
|
}, |
|
|
|
|
|
|
|
async update(annotationId, text) { |
|
|
|
await this.$services.seq2seq.changeText(this.projectId, this.item.id, annotationId, text) |
|
|
|
const label = this.annotations.find((a) => a.id === annotationId) |
|
|
|
label.updateText(text) |
|
|
|
await this.$repositories.textLabel.update(this.projectId, this.item.id, annotationId, label) |
|
|
|
await this.list(this.item.id) |
|
|
|
}, |
|
|
|
|
|
|
|
async clear() { |
|
|
|
await this.$services.seq2seq.clear(this.projectId, this.item.id) |
|
|
|
await this.$repositories.textLabel.clear(this.projectId, this.item.id) |
|
|
|
await this.list(this.item.id) |
|
|
|
}, |
|
|
|
|
|
|
|
async autoLabel(itemId) { |
|
|
|
try { |
|
|
|
await this.$services.seq2seq.autoLabel(this.projectId, itemId) |
|
|
|
await this.$repositories.textLabel.autoLabel(this.projectId, itemId) |
|
|
|
} catch (e) { |
|
|
|
console.log(e.response.data.detail) |
|
|
|
} |
|
|
|