Browse Source

Allow user to select relation labeling option

pull/1703/head
Hironsan 2 years ago
parent
commit
97d354b462
5 changed files with 25 additions and 5 deletions
  1. 10
      frontend/components/project/FormCreate.vue
  2. 7
      frontend/domain/models/project/project.ts
  3. 6
      frontend/pages/projects/index.vue
  4. 3
      frontend/services/application/project/projectApplicationService.ts
  5. 4
      frontend/services/application/project/projectData.ts

10
frontend/components/project/FormCreate.vue

@ -61,6 +61,12 @@
position="left"
contain
/>
<v-checkbox
v-if="isSequenceLabelingProject"
:value="useRelation"
label="Use relation labeling"
@change="updateValue('useRelation', $event === true)"
/>
<v-checkbox
v-if="isSequenceLabelingProject"
:value="graphemeMode"
@ -150,6 +156,10 @@ export default Vue.extend({
graphemeMode: {
type: Boolean,
default: false
},
useRelation: {
type: Boolean,
default: false
}
},

7
frontend/domain/models/project/project.ts

@ -36,6 +36,9 @@ export class ProjectReadItem {
@Expose({ name: 'grapheme_mode' })
graphemeMode: boolean;
@Expose({ name: 'use_relation' })
useRelation: boolean;
@Expose({ name: 'is_text_project'})
isTextProject: boolean;
@ -96,7 +99,8 @@ export class ProjectWriteItem {
public collaborative_annotation: boolean,
public single_class_classification: boolean,
public allow_overlapping: boolean,
public grapheme_mode: boolean
public grapheme_mode: boolean,
public use_relation: boolean,
) {}
get resourceType(): string {
@ -123,6 +127,7 @@ export class ProjectWriteItem {
single_class_classification: this.single_class_classification,
allow_overlapping: this.allow_overlapping,
grapheme_mode: this.grapheme_mode,
use_relation: this.use_relation,
resourcetype: this.resourceType
}
}

6
frontend/pages/projects/index.vue

@ -73,7 +73,8 @@ export default Vue.extend({
enableShareAnnotation: false,
singleClassClassification: false,
allowOverlapping: false,
graphemeMode: false
graphemeMode: false,
useRelation: false,
} as ProjectWriteDTO,
defaultItem: {
name: '',
@ -83,7 +84,8 @@ export default Vue.extend({
enableShareAnnotation: false,
singleClassClassification: false,
allowOverlapping: false,
graphemeMode: false
graphemeMode: false,
useRelation: false,
} as ProjectWriteDTO,
projects: {} as ProjectListDTO,
selected: [] as ProjectDTO[],

3
frontend/services/application/project/projectApplicationService.ts

@ -57,7 +57,8 @@ export class ProjectApplicationService {
item.enableShareAnnotation,
item.singleClassClassification,
item.allowOverlapping,
item.graphemeMode
item.graphemeMode,
item.useRelation
)
}
}

4
frontend/services/application/project/projectData.ts

@ -20,6 +20,7 @@ export class ProjectDTO {
hasCategory: boolean
hasSpan: boolean
taskNames: string[]
useRelation: boolean
constructor(item: ProjectReadItem) {
this.id = item.id
@ -41,10 +42,11 @@ export class ProjectDTO {
this.hasCategory = item.canDefineCategory
this.hasSpan = item.canDefineSpan
this.taskNames = item.taskNames
this.useRelation = item.useRelation
}
}
export type ProjectWriteDTO = Pick<ProjectDTO, 'id' | 'name' | 'description' | 'guideline' | 'projectType' | 'enableRandomOrder' | 'enableShareAnnotation' | 'singleClassClassification' | 'allowOverlapping' | 'graphemeMode' | 'tags'>
export type ProjectWriteDTO = Pick<ProjectDTO, 'id' | 'name' | 'description' | 'guideline' | 'projectType' | 'enableRandomOrder' | 'enableShareAnnotation' | 'singleClassClassification' | 'allowOverlapping' | 'graphemeMode' | 'tags' | 'useRelation'>
export class ProjectListDTO {
count: number

Loading…
Cancel
Save