Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit 8d5b796

Browse files
authored
Merge pull request #438 from rekeyz/master
Qa chat
2 parents 8216bfd + 6fbf889 commit 8d5b796

File tree

22 files changed

+1018
-278
lines changed

22 files changed

+1018
-278
lines changed

annotation-app/src/app/component/projects/annotate-progress-board/annotate-progress-board.component.html

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<h5>{{ msg?.from === 'review' ? 'Review' : 'Annotation' }} Progress</h5>
66
<div class="left-project-info fontSizeSmall">
77
<clr-progress-bar
8+
*ngIf="msg?.projectInfo.projectType != 'qaChat'"
89
title="{{
910
msg?.from === 'review'
1011
? 'Reviewed
@@ -25,7 +26,7 @@ <h5>{{ msg?.from === 'review' ? 'Review' : 'Annotation' }} Progress</h5>
2526
: 'Labeled Items'
2627
}}:&nbsp;&nbsp;{{ msg?.progressInfo?.completeCase }}
2728
</div>
28-
<div *ngIf="msg.from !== 'review'">
29+
<div *ngIf="msg.from !== 'review' && msg?.projectInfo.projectType != 'qaChat'">
2930
<cds-icon shape="circle" solid size="xs" style="color: rgb(229, 229, 299)"></cds-icon>
3031
Assigned Items:&nbsp;&nbsp;{{ msg?.progressInfo?.assignedCase }}
3132
</div>
@@ -142,8 +143,12 @@ <h5>Task Details</h5>
142143
Source:&nbsp;&nbsp;{{ msg?.projectInfo.dataSource }}
143144
</div>
144145
<div>Create Date:&nbsp;&nbsp;{{ msg?.projectInfo.createdDate | date : 'yyyy-MM-dd HH:mm:ss' }}</div>
145-
<div>Assignment Logic:&nbsp;&nbsp;{{ msg?.projectInfo.assignmentLogic }}</div>
146-
<div>Max Annotation:&nbsp;&nbsp;{{ msg?.projectInfo.maxAnnotation }}</div>
146+
<div *ngIf="msg?.projectInfo.projectType != 'qaChat'">
147+
Assignment Logic:&nbsp;&nbsp;{{ msg?.projectInfo.assignmentLogic }}
148+
</div>
149+
<div *ngIf="msg?.projectInfo.projectType != 'qaChat'">
150+
Max Annotation:&nbsp;&nbsp;{{ msg?.projectInfo.maxAnnotation }}
151+
</div>
147152
<div class="ellipsis" title="{{ msg?.projectInfo.taskInstructions }}">
148153
Instruction:&nbsp;&nbsp;{{ msg?.projectInfo.taskInstructions }}
149154
</div>
@@ -164,7 +169,8 @@ <h5>History</h5>
164169
*ngIf="
165170
msg.projectInfo.projectType == 'ner' ||
166171
(msg.projectInfo.projectType == 'qa' && msg.projectInfo.regression == false) ||
167-
msg.projectInfo.projectType == 'log'
172+
msg.projectInfo.projectType == 'log' ||
173+
msg.projectInfo.projectType == 'qaChat'
168174
"
169175
title="{{ flag.text }}"
170176
>
@@ -178,7 +184,8 @@ <h5>History</h5>
178184
msg.projectInfo.projectType !== 'ner' &&
179185
!(msg.projectInfo.projectType == 'qa' && msg.projectInfo.regression == false) &&
180186
msg.projectInfo.projectType !== 'image' &&
181-
msg.projectInfo.projectType !== 'log'
187+
msg.projectInfo.projectType !== 'log' &&
188+
msg.projectInfo.projectType !== 'qaChat'
182189
"
183190
title="{{ flag.key + ':' + flag.value }}"
184191
>

annotation-app/src/app/component/projects/create-project/create-project.component.html

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<option value="image">Image Classification</option>
8080
<option value="log">Log Classification</option>
8181
<option value="qa">Question Answer</option>
82+
<option value="qaChat">Question Answer Conversational</option>
8283
</select>
8384
</div>
8485
<div class="clr-col-12 clr-col-md-1">
@@ -103,7 +104,7 @@
103104
></textarea>
104105
</div>
105106
</div>
106-
<div class="clr-row formField">
107+
<div *ngIf="dsDialogForm.get('projectType').value != 'qaChat'" class="clr-row formField">
107108
<label for="annotationDisplayName" class="label-tooltip clr-col-12 clr-col-md-2"
108109
>Annotation Display Name
109110
<clr-tooltip>
@@ -137,7 +138,7 @@
137138
</clr-tooltip>
138139
</div>
139140
</div>
140-
<div class="clr-row formField">
141+
<div *ngIf="dsDialogForm.get('projectType').value != 'qaChat'" class="clr-row formField">
141142
<label for="annotationQuestion" class="label-tooltip clr-col-12 clr-col-md-2"
142143
>Annotation Question
143144
<clr-tooltip>
@@ -173,6 +174,7 @@
173174
</div>
174175
</clr-wizard-page>
175176
<clr-wizard-page
177+
*ngIf="dsDialogForm.get('projectType').value != 'qaChat'"
176178
[id]="2"
177179
(clrWizardPageOnLoad)="clrWizardPageOnLoad($event)"
178180
[clrWizardPageNextDisabled]="!dsDialogForm.get('selectedDataset').value"
@@ -306,7 +308,11 @@
306308
<!-- select label and text column -->
307309
<clr-wizard-page
308310
[id]="3"
309-
*ngIf="dsDialogForm.get('projectType').value !== 'image' && dsDialogForm.get('projectType').value !== 'log'"
311+
*ngIf="
312+
dsDialogForm.get('projectType').value !== 'image' &&
313+
dsDialogForm.get('projectType').value !== 'log' &&
314+
dsDialogForm.get('projectType').value !== 'qaChat'
315+
"
310316
(clrWizardPageCustomButton)="doCustomClick($event)"
311317
[clrWizardPageNextDisabled]="
312318
dsDialogForm.get('projectType').value === 'ner' || dsDialogForm.get('projectType').value === 'qa'
@@ -503,7 +509,7 @@
503509
</clr-wizard-page>
504510
<clr-wizard-page
505511
[id]="4"
506-
*ngIf="dsDialogForm.get('projectType').value !== 'qa'"
512+
*ngIf="dsDialogForm.get('projectType').value !== 'qa' && dsDialogForm.get('projectType').value !== 'qaChat'"
507513
[clrWizardPageNextDisabled]="clrWizardPageNextDisabled.page4"
508514
(clrWizardPageOnLoad)="clrWizardPageOnLoad($event)"
509515
>
@@ -903,7 +909,7 @@
903909
<ng-template clrPageTitle>Assign Team Members</ng-template>
904910
<div [formGroup]="dsDialogForm">
905911
<!-- total row -->
906-
<div class="clr-row formField">
912+
<div *ngIf="dsDialogForm.get('projectType').value !== 'qaChat'" class="clr-row formField">
907913
<label for="totalRow" class="label-tooltip clr-col-12 clr-col-md-2">{{
908914
dsDialogForm.get('projectType').value === 'image'
909915
? 'Total Items'
@@ -925,7 +931,7 @@
925931
</div>
926932
</div>
927933
<!-- maxAnnotations -->
928-
<div class="clr-row formField">
934+
<div *ngIf="dsDialogForm.get('projectType').value !== 'qaChat'" class="clr-row formField">
929935
<label for="maxAnnotations" class="label-tooltip clr-col-12 clr-col-md-2"
930936
>Max Annotations Per Case<span>*</span>
931937
<clr-tooltip>
@@ -1042,8 +1048,13 @@
10421048
[ngModelOptions]="{ standalone: true }"
10431049
/>
10441050
</div>
1045-
<div style="margin-right: 0.5rem; margin-left: 0.5rem">-</div>
1046-
<div class="clr-input-wrapper clr-col-4">
1051+
<div
1052+
*ngIf="dsDialogForm.get('projectType').value !== 'qaChat'"
1053+
style="margin-right: 0.5rem; margin-left: 0.5rem"
1054+
>
1055+
-
1056+
</div>
1057+
<div *ngIf="dsDialogForm.get('projectType').value !== 'qaChat'" class="clr-input-wrapper clr-col-4">
10471058
<input
10481059
type="number"
10491060
class="clr-input"
@@ -1204,7 +1215,7 @@
12041215
</div>
12051216
</clr-wizard-page>
12061217
<clr-wizard-page
1207-
*ngIf="dsDialogForm.get('projectType').value !== 'image'"
1218+
*ngIf="dsDialogForm.get('projectType').value !== 'image' && dsDialogForm.get('projectType').value !== 'qaChat'"
12081219
[id]="6"
12091220
[clrWizardPageNextDisabled]="
12101221
isShowNumeric ||

annotation-app/src/app/component/projects/create-project/create-project.component.ts

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ export class CreateProjectComponent implements OnInit {
184184
}
185185
if (e === 'clr-wizard-page-5') {
186186
this.toEvenlyDistributeTicket();
187-
if (this.dsDialogForm.get('totalRow').value < 1 || this.dsDialogForm.get('maxAnnotations').value < 0) {
187+
if (
188+
this.dsDialogForm.get('projectType').value !== 'qaChat' &&
189+
(this.dsDialogForm.get('totalRow').value < 1 || this.dsDialogForm.get('maxAnnotations').value < 0)
190+
) {
188191
return (this.clrWizardPageNextDisabled.page5 = true);
189192
}
190193
if (!this.assignType[0].checked && !this.assignType[1].checked) {
@@ -201,6 +204,10 @@ export class CreateProjectComponent implements OnInit {
201204
}
202205
}
203206
this.clrWizardPageNextDisabled.page5 = false;
207+
if (this.dsDialogForm.get('projectType').value === 'qaChat') {
208+
this.clrWizardPageNextDisabled.page4 = false;
209+
this.clrWizardPageNextDisabled.page6 = false;
210+
}
204211
return;
205212
}
206213
if (e === 'clr-wizard-page-6') {
@@ -336,11 +343,6 @@ export class CreateProjectComponent implements OnInit {
336343
if ('custom-previous' === buttonType) {
337344
this.wizard.previous();
338345
}
339-
340-
// if ('custom-finish' === buttonType) {
341-
// // if click the image type finish in assign email page
342-
// this.toCreate();
343-
// }
344346
}
345347

346348
createForm(): void {
@@ -517,37 +519,14 @@ export class CreateProjectComponent implements OnInit {
517519
this.checkboxChecked = [];
518520
this.helpfulText = [];
519521
}
520-
521-
// if (this.dsDialogForm.get('projectType').value !== 'ner') {
522-
// this.dsDialogForm.get('labels').setValue([]);
523-
// this.categoryList = [];
524-
// }
525-
// this.isShowLabelRadio = false;
526-
// this.nonEnglish = 0;
527-
// this.totalCase = 0;
528-
// this.dsDialogForm.get('totalRow').setValue(0);
529-
// this.minLabel = null;
530-
// this.maxLabel = null;
531-
// this.dsDialogForm.get('min').setValue(null);
532-
// this.dsDialogForm.get('max').setValue(null);
533-
// this.labelType = '';
534-
// this.isNumeric = null;
535-
// this.isShowNumeric = false;
536-
// this.dsDialogForm.get('multipleLabel').setValue(null);
537-
// this.isMultipleLabel = null;
538-
// this.isMutilNumericLabel = false;
539-
// this.isUploadLabel = false;
540-
// this.dsDialogForm.get('mutilLabelArray').reset();
541-
// while (this.mutilLabelArray.length > 2) {
542-
// this.mutilLabelArray.removeAt(2);
543-
// }
544522
}
545523

546524
changeProjectType() {
547525
this.clearFormdata(1);
548526
this.dealAnnotationQuestionTex(this.dsDialogForm.value.projectType);
549-
this.getMyDatasets(this.dsDialogForm.get('projectType').value).then((res) => {});
527+
this.getMyDatasets(this.dsDialogForm.get('projectType').value);
550528
}
529+
551530
dealAnnotationQuestionTex(type) {
552531
const questesion = {
553532
qa: 'Label all answers in the given text corpus according to the question.',
@@ -556,7 +535,11 @@ export class CreateProjectComponent implements OnInit {
556535
let questionTex = Object.keys(questesion).includes(type) ? questesion[type] : this.dataset.annotationQuestion;
557536
this.dsDialogForm.get('annotationQuestion').setValue(questionTex);
558537
}
538+
559539
getMyDatasets(projectType) {
540+
if (projectType == 'qaChat') {
541+
return;
542+
}
560543
let a =
561544
projectType == 'text' || projectType == 'tabular' || projectType == 'ner' || projectType == 'qa'
562545
? 'csv'
@@ -1182,6 +1165,12 @@ export class CreateProjectComponent implements OnInit {
11821165
formData.append('pname', this.dsDialogForm.value.projectName);
11831166
formData.append('projectType', this.dsDialogForm.value.projectType);
11841167
formData.append('taskInstruction', this.dsDialogForm.value.taskInstruction);
1168+
formData.append('assignee', JSON.stringify(this.toCheckAssigneeList()));
1169+
if (this.dsDialogForm.value.projectType === 'qaChat') {
1170+
formData.append('isMultipleLabel', 'true');
1171+
formData.append('labels', '');
1172+
return this.apiService.postDataset(formData);
1173+
}
11851174
formData.append('ticketDescription', this.dsDialogForm.value.annotationDisplayName);
11861175
formData.append('annotationQuestion', this.dsDialogForm.value.annotationQuestion);
11871176
formData.append('fileName', this.datasetInfo.fileName);
@@ -1236,7 +1225,6 @@ export class CreateProjectComponent implements OnInit {
12361225
formData.append('slack', this.assignType[1].checked ? JSON.stringify(this.slackList) : '[]');
12371226
formData.append('maxAnnotations', this.dsDialogForm.value.maxAnnotations);
12381227
formData.append('assignmentLogic', this.dsDialogForm.value.assignmentLogic);
1239-
formData.append('assignee', JSON.stringify(this.toCheckAssigneeList()));
12401228
formData.append('min', this.categoryListInfoToCategoryList()[0].min);
12411229
formData.append('max', this.categoryListInfoToCategoryList()[0].max);
12421230
formData.append('estimator', this.dsDialogForm.value.selectedClassifier);

annotation-app/src/app/component/projects/download/download.component.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Copyright 2019-2023 VMware, Inc.
1+
<!-- Copyright 2019-2024 VMware, Inc.
22
SPDX-License-Identifier: Apache-2.0 -->
33

44
<div class="modal footerLeft">
@@ -71,7 +71,8 @@ <h3 class="modal-title">Download Datasets</h3>
7171
msg.projectType == 'qa' ||
7272
msg.projectType == 'image' ||
7373
msg.labelType == 'numericLabel' ||
74-
msg.projectType == 'log'
74+
msg.projectType == 'log' ||
75+
msg.projectType == 'qaChat'
7576
"
7677
/>
7778
<label>Top Label</label>
@@ -89,13 +90,14 @@ <h3 class="modal-title">Download Datasets</h3>
8990
msg.projectType == 'qa' ||
9091
msg.projectType == 'image' ||
9192
msg.labelType == 'numericLabel' ||
92-
msg.projectType == 'log'
93+
msg.projectType == 'log' ||
94+
msg.projectType == 'qaChat'
9395
"
9496
/>
9597
<label>Probabilistic</label>
9698
</clr-radio-wrapper>
9799
</clr-radio-container>
98-
<div class="clr-checkbox-wrapper removeEntry">
100+
<div *ngIf="msg.projectType !== 'qaChat'" class="clr-checkbox-wrapper removeEntry">
99101
<input
100102
type="checkbox"
101103
id="removeUnlabel"

annotation-app/src/app/component/projects/generate/generate.component.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Copyright 2019-2023 VMware, Inc.
1+
<!-- Copyright 2019-2024 VMware, Inc.
22
SPDX-License-Identifier: Apache-2.0 -->
33

44
<div class="modal footerLeft">
@@ -54,7 +54,8 @@ <h3 class="modal-title">Generate Datasets</h3>
5454
msg.projectType == 'qa' ||
5555
msg.projectType == 'image' ||
5656
msg.projectType == 'log' ||
57-
msg.labelType == 'numericLabel'
57+
msg.labelType == 'numericLabel' ||
58+
msg.projectType == 'qaChat'
5859
"
5960
/>
6061
<label>Top Label</label>
@@ -72,13 +73,14 @@ <h3 class="modal-title">Generate Datasets</h3>
7273
msg.projectType == 'qa' ||
7374
msg.projectType == 'image' ||
7475
msg.projectType == 'log' ||
75-
msg.labelType == 'numericLabel'
76+
msg.labelType == 'numericLabel' ||
77+
msg.projectType == 'qaChat'
7678
"
7779
/>
7880
<label>Probabilistic</label>
7981
</clr-radio-wrapper>
8082
</clr-radio-container>
81-
<div class="clr-checkbox-wrapper removeEntry">
83+
<div *ngIf="msg.projectType !== 'qaChat'" class="clr-checkbox-wrapper removeEntry">
8284
<input
8385
type="checkbox"
8486
id="removeUnlabel"

annotation-app/src/app/component/projects/labeling-task-list/edit-project/edit-project.component.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Copyright 2019-2023 VMware, Inc.
1+
<!-- Copyright 2019-2024 VMware, Inc.
22
SPDX-License-Identifier: Apache-2.0 -->
33

44
<div class="modal">
@@ -217,7 +217,9 @@ <h3 class="modal-title">Edit Project</h3>
217217
class="clr-input"
218218
title="Number of tickets assigned"
219219
placeholder="Number of tickets assigned"
220-
[disabled]="!(user.email && !user.setUserErrMessage && !user.emailReg)"
220+
[disabled]="
221+
!(user.email && !user.setUserErrMessage && !user.emailReg) || msg.projectType == 'qaChat'
222+
"
221223
[(ngModel)]="user.assignedCase"
222224
(blur)="inputTicketsUpdate(user)"
223225
style="width: 100%"
@@ -783,7 +785,10 @@ <h3 class="modal-title">Edit Project</h3>
783785
</div>
784786
<div
785787
class="prev-info clr-row"
786-
*ngIf="labelType == 'numericLabel' || msg.projectType == 'ner' || msg.isMultipleLabel"
788+
*ngIf="
789+
(labelType == 'numericLabel' || msg.projectType == 'ner' || msg.isMultipleLabel) &&
790+
msg.projectType !== 'qaChat'
791+
"
787792
>
788793
<label for="assignmentLogicEdit" class="label-tooltip clr-col-12 clr-col-md-2">Assignment Logic</label>
789794
<div class="clr-input-wrapper clr-col-12 clr-col-md-8">

annotation-app/src/app/component/projects/labeling-task-list/edit-project/edit-project.component.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2019-2023 VMware, Inc.
2+
Copyright 2019-2024 VMware, Inc.
33
SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -96,7 +96,12 @@ export class EditProjectComponent implements OnInit {
9696
this.msg = JSON.parse(JSON.stringify(this.msgInEdit));
9797
const al = this.msg.al;
9898
this.previousProjectName = this.msg.projectName;
99-
this.showLabel = !((this.msg.integration.source && this.msg.integration.externalId[0]) || this.msg.projectType == "qa" || this.msg.labelType == "HTL");
99+
this.showLabel = !(
100+
(this.msg.integration.source && this.msg.integration.externalId[0]) ||
101+
this.msg.projectType == 'qa' ||
102+
this.msg.labelType == 'HTL' ||
103+
this.msg.projectType == 'qaChat'
104+
);
100105
this.inputProjectName = this.msg.projectName;
101106
this.inputTaskInstruction = this.msg.taskInstructions;
102107
this.inputfrequency = al.frequency ? al.frequency : null;
@@ -150,7 +155,7 @@ export class EditProjectComponent implements OnInit {
150155
} else if (this.labelType === 'HTL') {
151156
this.categoryList = this.msg.categoryList;
152157
} else {
153-
this.msg.categoryList.split(',').forEach((element) => {
158+
this.msg.categoryList?.split(',').forEach((element) => {
154159
const flag = { status: 'old', originalLabel: element, editLabel: element };
155160
this.categoryList.push(flag);
156161
});

0 commit comments

Comments
 (0)