Browse Source

Remove seq2seq application service

pull/2197/head
Hironsan 1 year ago
parent
commit
cc96a350a7
3 changed files with 0 additions and 42 deletions
  1. 3
      frontend/plugins/services.ts
  2. 26
      frontend/services/application/tasks/seq2seq/seq2seqApplicationService.ts
  3. 13
      frontend/services/application/tasks/seq2seq/seq2seqData.ts

3
frontend/plugins/services.ts

@ -7,7 +7,6 @@ import { ProjectApplicationService } from '@/services/application/project/projec
import { TagApplicationService } from '@/services/application/tag/tagApplicationService'
import { BoundingBoxApplicationService } from '@/services/application/tasks/boundingBox/boundingBoxApplicationService'
import { SegmentationApplicationService } from '@/services/application/tasks/segmentation/segmentationApplicationService'
import { Seq2seqApplicationService } from '@/services/application/tasks/seq2seq/seq2seqApplicationService'
import { SequenceLabelingApplicationService } from '@/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService'
export interface Services {
@ -17,7 +16,6 @@ export interface Services {
project: ProjectApplicationService
example: ExampleApplicationService
sequenceLabeling: SequenceLabelingApplicationService
seq2seq: Seq2seqApplicationService
option: OptionApplicationService
tag: TagApplicationService
bbox: BoundingBoxApplicationService
@ -41,7 +39,6 @@ const plugin: Plugin = (_, inject) => {
repositories.span,
repositories.relation
),
seq2seq: new Seq2seqApplicationService(repositories.textLabel),
option: new OptionApplicationService(repositories.option),
tag: new TagApplicationService(repositories.tag),
bbox: new BoundingBoxApplicationService(repositories.boundingBox),

26
frontend/services/application/tasks/seq2seq/seq2seqApplicationService.ts

@ -1,26 +0,0 @@
import { AnnotationApplicationService } from '../annotationApplicationService'
import { Seq2seqDTO } from './seq2seqData'
import { TextLabel } from '@/domain/models/tasks/textLabel'
export class Seq2seqApplicationService extends AnnotationApplicationService<TextLabel> {
public async list(projectId: string, exampleId: number): Promise<Seq2seqDTO[]> {
const items = await this.repository.list(projectId, exampleId)
return items.map((item) => new Seq2seqDTO(item))
}
public async create(projectId: string, exampleId: number, text: string): Promise<void> {
const item = new TextLabel(0, text, 0)
await this.repository.create(projectId, exampleId, item)
}
public async changeText(
projectId: string,
exampleId: number,
labelId: number,
text: string
): Promise<void> {
const textLabel = await this.repository.find(projectId, exampleId, labelId)
textLabel.updateText(text)
await this.repository.update(projectId, exampleId, labelId, textLabel)
}
}

13
frontend/services/application/tasks/seq2seq/seq2seqData.ts

@ -1,13 +0,0 @@
import { TextLabel } from '@/domain/models/tasks/textLabel'
export class Seq2seqDTO {
id: number
text: string
user: number
constructor(item: TextLabel) {
this.id = item.id
this.text = item.text
this.user = item.user
}
}
Loading…
Cancel
Save