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.
20 lines
578 B
20 lines
578 B
import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
|
|
import { Span } from '@/domain/models/tasks/span'
|
|
|
|
export class APISpanRepository extends AnnotationRepository<Span> {
|
|
labelName = 'spans'
|
|
|
|
toModel(item: { [key: string]: any }): Span {
|
|
return new Span(item.id, item.label, item.user, item.start_offset, item.end_offset)
|
|
}
|
|
|
|
toPayload(item: Span): { [key: string]: any } {
|
|
return {
|
|
id: item.id,
|
|
label: item.label,
|
|
user: item.user,
|
|
start_offset: item.startOffset,
|
|
end_offset: item.endOffset
|
|
}
|
|
}
|
|
}
|