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.
19 lines
543 B
19 lines
543 B
import { AnnotationRepository } from '@/domain/models/tasks/annotationRepository'
|
|
import { Relation } from '@/domain/models/tasks/relation'
|
|
|
|
export class APIRelationRepository extends AnnotationRepository<Relation> {
|
|
labelName = 'relations'
|
|
|
|
toModel(item: { [key: string]: any }): Relation {
|
|
return new Relation(item.id, item.from_id, item.to_id, item.type)
|
|
}
|
|
|
|
toPayload(item: Relation): { [key: string]: any } {
|
|
return {
|
|
id: item.id,
|
|
from_id: item.fromId,
|
|
to_id: item.toId,
|
|
type: item.type
|
|
}
|
|
}
|
|
}
|