Browse Source

Add auto label method to the repository

pull/1251/head
Hironsan 4 years ago
parent
commit
8e2d70ba4f
2 changed files with 7 additions and 0 deletions
  1. 5
      frontend/repositories/tasks/text-classification/api.ts
  2. 2
      frontend/repositories/tasks/text-classification/interface.ts

5
frontend/repositories/tasks/text-classification/api.ts

@ -30,4 +30,9 @@ export class FromApiTextClassificationRepository implements TextClassificationRe
const url = `/projects/${projectId}/docs/${docId}/annotations`
await this.request.delete(url)
}
public async autoLabel(projectId: string, docId: number): Promise<void> {
const url = `/projects/${projectId}/docs/${docId}/auto-labeling`
await this.request.post(url, {})
}
}

2
frontend/repositories/tasks/text-classification/interface.ts

@ -8,4 +8,6 @@ export interface TextClassificationRepository {
delete(projectId: string, docId: number, annotationId: number): Promise<void>
clear(projectId: string, docId: number): Promise<void>
autoLabel(projectId: string, docId: number): Promise<void>
}
Loading…
Cancel
Save