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.
18 lines
503 B
18 lines
503 B
import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
|
|
import { Category } from '@/domain/models/tasks/category'
|
|
|
|
export class APICategoryRepository extends AnnotationRepository<Category> {
|
|
labelName = 'categories'
|
|
|
|
toModel(item: { [key: string]: any }): Category {
|
|
return new Category(item.id, item.label, item.user)
|
|
}
|
|
|
|
toPayload(item: Category): { [key: string]: any } {
|
|
return {
|
|
id: item.id,
|
|
label: item.label,
|
|
user: item.user
|
|
}
|
|
}
|
|
}
|