mirror of https://github.com/doccano/doccano.git
pythondatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learningannotation-tool
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.
19 lines
544 B
19 lines
544 B
import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
|
|
import { Segment } from '@/domain/models/tasks/segmentation'
|
|
|
|
export class APISegmentationRepository extends AnnotationRepository<Segment> {
|
|
labelName = 'segments'
|
|
|
|
toModel(item: { [key: string]: any }): Segment {
|
|
return new Segment(item.id, item.uuid, item.label, item.points)
|
|
}
|
|
|
|
toPayload(item: Segment): { [key: string]: any } {
|
|
return {
|
|
id: item.id,
|
|
uuid: item.uuid,
|
|
label: item.label,
|
|
points: item.points
|
|
}
|
|
}
|
|
}
|