From 427d15ddc12e112022ee42846ddb351a847e1420 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Sun, 31 Jul 2022 09:36:16 +0900 Subject: [PATCH] Rename repository names --- frontend/plugins/repositories.ts | 18 +++++++++--------- ...ssification.ts => apiCategoryRepository.ts} | 2 +- ...equenceLabeling.ts => apiSpanRepository.ts} | 2 +- ...apiSeq2seq.ts => apiTextLabelRepository.ts} | 2 +- .../sequenceLabelingApplicationService.ts | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) rename frontend/repositories/tasks/{apiTextClassification.ts => apiCategoryRepository.ts} (83%) rename frontend/repositories/tasks/{apiSequenceLabeling.ts => apiSpanRepository.ts} (86%) rename frontend/repositories/tasks/{apiSeq2seq.ts => apiTextLabelRepository.ts} (84%) diff --git a/frontend/plugins/repositories.ts b/frontend/plugins/repositories.ts index 90783117..e93b8b6a 100644 --- a/frontend/plugins/repositories.ts +++ b/frontend/plugins/repositories.ts @@ -2,8 +2,8 @@ import { Plugin } from '@nuxt/types' import { APITaskStatusRepository } from '@/repositories/celery/apiTaskStatusRepository' import { APICatalogRepository } from '@/repositories/upload/apiCatalogRepository' import { APIParseRepository } from '@/repositories/upload/apiParseRepository' -import { APISequenceLabelingRepository } from '@/repositories/tasks/apiSequenceLabeling' -import { APISeq2seqRepository } from '@/repositories/tasks/apiSeq2seq' +import { APISpanRepository } from '@/repositories/tasks/apiSpanRepository' +import { APITextLabelRepository } from '@/repositories/tasks/apiTextLabelRepository' import { APIConfigRepository } from '@/repositories/autoLabeling/config/apiConfigRepository' import { APITemplateRepository } from '@/repositories/autoLabeling/template/apiTemplateRepository' import { APIUserRepository } from '@/repositories/user/apiUserRepository' @@ -16,7 +16,7 @@ import { APILabelRepository } from '@/repositories/label/apiLabelRepository' import { APIExampleRepository } from '@/repositories/example/apiDocumentRepository' import { APICommentRepository } from '@/repositories/comment/apiCommentRepository' import { APIAuthRepository } from '@/repositories/auth/apiAuthRepository' -import { APITextClassificationRepository } from '@/repositories/tasks/apiTextClassification' +import { APICategoryRepository } from '@/repositories/tasks/apiCategoryRepository' import { APIDownloadFormatRepository } from '@/repositories/download/apiDownloadFormatRepository' import { APIDownloadRepository } from '@/repositories/download/apiDownloadRepository' import { APITagRepository } from '@/repositories/tag/apiTagRepository' @@ -60,10 +60,10 @@ export interface Repositories { relationType: APILabelRepository // Label - category: APITextClassificationRepository - span: APISequenceLabelingRepository + category: APICategoryRepository + span: APISpanRepository relation: APIRelationRepository - textLabel: APISeq2seqRepository + textLabel: APITextLabelRepository boundingBox: APIBoundingBoxRepository segmentation: APISegmentationRepository } @@ -110,10 +110,10 @@ const repositories: Repositories = { relationType: new APILabelRepository('relation-type'), // Label - category: new APITextClassificationRepository(), - span: new APISequenceLabelingRepository(), + category: new APICategoryRepository(), + span: new APISpanRepository(), relation: new APIRelationRepository(), - textLabel: new APISeq2seqRepository(), + textLabel: new APITextLabelRepository(), boundingBox: new APIBoundingBoxRepository(), segmentation: new APISegmentationRepository() } diff --git a/frontend/repositories/tasks/apiTextClassification.ts b/frontend/repositories/tasks/apiCategoryRepository.ts similarity index 83% rename from frontend/repositories/tasks/apiTextClassification.ts rename to frontend/repositories/tasks/apiCategoryRepository.ts index 60abcbc2..ffc3e12e 100644 --- a/frontend/repositories/tasks/apiTextClassification.ts +++ b/frontend/repositories/tasks/apiCategoryRepository.ts @@ -1,7 +1,7 @@ import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository' import { Category } from '@/domain/models/tasks/category' -export class APITextClassificationRepository extends AnnotationRepository { +export class APICategoryRepository extends AnnotationRepository { labelName = 'categories' toModel(item: { [key: string]: any }): Category { diff --git a/frontend/repositories/tasks/apiSequenceLabeling.ts b/frontend/repositories/tasks/apiSpanRepository.ts similarity index 86% rename from frontend/repositories/tasks/apiSequenceLabeling.ts rename to frontend/repositories/tasks/apiSpanRepository.ts index 7b08ff25..167db0e5 100644 --- a/frontend/repositories/tasks/apiSequenceLabeling.ts +++ b/frontend/repositories/tasks/apiSpanRepository.ts @@ -1,7 +1,7 @@ import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository' import { Span } from '@/domain/models/tasks/span' -export class APISequenceLabelingRepository extends AnnotationRepository { +export class APISpanRepository extends AnnotationRepository { labelName = 'spans' toModel(item: { [key: string]: any }): Span { diff --git a/frontend/repositories/tasks/apiSeq2seq.ts b/frontend/repositories/tasks/apiTextLabelRepository.ts similarity index 84% rename from frontend/repositories/tasks/apiSeq2seq.ts rename to frontend/repositories/tasks/apiTextLabelRepository.ts index cc7f70a8..74d2ad04 100644 --- a/frontend/repositories/tasks/apiSeq2seq.ts +++ b/frontend/repositories/tasks/apiTextLabelRepository.ts @@ -1,7 +1,7 @@ import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository' import { TextLabel } from '@/domain/models/tasks/textLabel' -export class APISeq2seqRepository extends AnnotationRepository { +export class APITextLabelRepository extends AnnotationRepository { labelName = 'texts' toModel(item: { [key: string]: any }): TextLabel { diff --git a/frontend/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService.ts b/frontend/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService.ts index a1e95c0d..f841e9b8 100644 --- a/frontend/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService.ts +++ b/frontend/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService.ts @@ -1,4 +1,4 @@ -import { APISequenceLabelingRepository } from '@/repositories/tasks/apiSequenceLabeling' +import { APISpanRepository } from '@/repositories/tasks/apiSpanRepository' import { APIRelationRepository } from '@/repositories/tasks/apiRelationRepository' import { Span } from '@/domain/models/tasks/span' import { Relation } from '@/domain/models/tasks/relation' @@ -8,10 +8,10 @@ import { SpanDTO } from './sequenceLabelingData' export class SequenceLabelingApplicationService extends AnnotationApplicationService { constructor( - readonly repository: APISequenceLabelingRepository, + readonly repository: APISpanRepository, readonly relationRepository: APIRelationRepository ) { - super(new APISequenceLabelingRepository()) + super(new APISpanRepository()) } public async list(projectId: string, exampleId: number): Promise {