From 7edbb9355978a598f002d058e97feb380f35055a Mon Sep 17 00:00:00 2001 From: Hironsan Date: Mon, 6 Mar 2023 16:10:20 +0900 Subject: [PATCH] Remove seq2seq service from speech to text page --- .../pages/projects/_id/speech-to-text/index.vue | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/pages/projects/_id/speech-to-text/index.vue b/frontend/pages/projects/_id/speech-to-text/index.vue index 89743b9a..d2e1cadd 100644 --- a/frontend/pages/projects/_id/speech-to-text/index.vue +++ b/frontend/pages/projects/_id/speech-to-text/index.vue @@ -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) }