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.
26 lines
488 B
26 lines
488 B
export class RelationItem {
|
|
constructor(public id: number, public fromId: number, public toId: number, public type: number) {}
|
|
|
|
static valueOf({
|
|
id,
|
|
from_id,
|
|
to_id,
|
|
type
|
|
}: {
|
|
id: number
|
|
from_id: number
|
|
to_id: number
|
|
type: number
|
|
}): RelationItem {
|
|
return new RelationItem(id, from_id, to_id, type)
|
|
}
|
|
|
|
toObject(): Object {
|
|
return {
|
|
id: this.id,
|
|
from_id: this.fromId,
|
|
to_id: this.toId,
|
|
type: this.type
|
|
}
|
|
}
|
|
}
|