mirror of https://github.com/doccano/doccano.git
pythonannotation-tooldatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learning
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
773 B
16 lines
773 B
import { AnnotationApplicationService } from '../annotationApplicationService'
|
|
import { TextClassificationDTO } from './textClassificationData'
|
|
import { TextClassificationItem } from '~/domain/models/tasks/textClassification'
|
|
|
|
export class TextClassificationApplicationService extends AnnotationApplicationService<TextClassificationItem> {
|
|
|
|
public async list(projectId: string, docId: number): Promise<TextClassificationDTO[]> {
|
|
const items = await this.repository.list(projectId, docId)
|
|
return items.map(item => new TextClassificationDTO(item))
|
|
}
|
|
|
|
public async create(projectId: string, docId: number, labelId: number): Promise<void> {
|
|
const item = new TextClassificationItem(0, labelId, 0)
|
|
await this.repository.create(projectId, docId, item)
|
|
}
|
|
}
|