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

Commit 0e17a17

Browse files
author
Joe Qiao
committed
bug fix
1 parent 9ea81a8 commit 0e17a17

File tree

6 files changed

+21
-16
lines changed

6 files changed

+21
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ annotation-app/.npmrc
77
annotation-app/chart
88
annotation-app/src/environments/environment.stg.ts
99
annotation-app/src/environments/environment.test.ts
10+
annotation-app/.angular
1011
# annotation-app/package-lock.json
1112
annotation-app/tsconfig.spec.json
1213
annotation-app/dist

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Core features include:
1616
- Tabular classification and regresion
1717
- Images recognition with bounding boxes and polygons
1818
- Log labeling
19+
- Question answer
1920
- Active learning with uncertainly sampling to query unlabeled data
2021
- Project tracking with real time data aggregation and review process
2122
- User management panel with role-based access control

annotation-app/src/app/components/projects/annotate/annotate.component.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,10 +916,13 @@ <h4 style="margin-top: 2rem; margin-left: 0.5rem">
916916
>
917917
<label class="circle" [style.background-color]="getLabelColor(item)">&nbsp;&nbsp;<b>{{index+1}}</b></label>
918918
<clr-radio-wrapper class="clr-col-10">
919-
<input type="radio" clrRadio name="questionRadio" class="questionRadio"
919+
<input clrRadio
920+
class="questionRadio"
921+
type="radio"
922+
name="questionRadio"
920923
value="{{item}}"
921-
(change)="onSelectingEntity($event, index, index)"
922-
[attr.checked]="index == 0?'checked': null "
924+
(change)="onSelectingEntity($event, item, index)"
925+
[attr.checked]="index == 0?'checked': null"
923926
/>
924927
<label (change)="editQuestion($event, index)">
925928
<textarea

annotation-app/src/app/components/projects/annotate/annotate.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,9 @@ export class AnnotateComponent implements OnInit, AfterViewInit, OnDestroy {
346346
this.toReadStorageSetting('display');
347347
}
348348
if (this.projectType == 'ner' || this.projectType == 'qa') {
349-
this.getQuestionListAndSetQuestionColors(this.sr.questionForText);
350349
this.sr = this.resetNerSrData(this.sr);
351350
this.toShowExistingLabel();
351+
this.getQuestionListAndSetQuestionColors(this.sr.questionForText);
352352
}
353353
if (this.projectType == 'image') {
354354
this.sr = this.resetImageSrData(this.sr);

annotation-service/services/project.service.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ async function getProjects(req) {
3030

3131
if (src == SRCS.ANNOTATE) {
3232
console.log(`[ PROJECT ] Service query current annotator project list`);
33-
const annotateConditions = { annotator: { $regex: email } };
34-
const logReviewConditions = { creator: { $regex: email }, annotator: { $not: { $size: 0 } } };
33+
const annotateConditions = { annotator: email };
34+
const logReviewConditions = { creator: email, annotator: { $not: { $size: 0 } } };
3535
condition = { $or: [annotateConditions, logReviewConditions] };
3636
} else if (src == SRCS.PROJECTS && user.role != "Annotator") {
37-
condition = { creator: { $regex: email } };
37+
condition = { creator: email };
3838
} else if (src == SRCS.ADMIN && user.role == "Admin") {
3939
condition = {};
4040
} else if (src == SRCS.COMMUNITY) {
@@ -56,7 +56,7 @@ async function getProjects(req) {
5656

5757
async function getProjectByAnnotator(req) {
5858
console.log(`[ PROJECT ] Service query project name by annotator: ${req.auth.email}`);
59-
const condition = { annotator: { $regex: req.auth.email } };
59+
const condition = { annotator: req.auth.email };
6060
const columns = "projectName";
6161
return mongoDb.findByConditions(ProjectModel, condition, columns);
6262
}
@@ -559,7 +559,7 @@ async function getReviewList(req) {
559559
const user = req.auth.email;
560560
await validator.checkAnnotator(user);
561561

562-
const conditions = { creator: { $regex: user }, projectType: PROJECTTYPE.LOG };
562+
const conditions = { creator: user, projectType: PROJECTTYPE.LOG };
563563
const options = { sort: { updatedDate: -1 } };
564564
return mongoDb.findByConditions(ProjectModel, conditions, null, options);
565565
}
@@ -1052,7 +1052,7 @@ async function getProjectsTextTabular(email) {
10521052
{ projectType: PROJECTTYPE.TABULAR }
10531053
];
10541054
condition.$or = [
1055-
{ annotator: { $regex: email } },
1055+
{ annotator: email },
10561056
{ assignSlackChannels: { $exists: true } }
10571057
];
10581058
return mongoDb.findByConditions(ProjectModel, condition, project, options);

annotation-service/utils/srsImporter.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ module.exports = {
4545
fork: true,
4646
flatKeys: true,
4747
headers: header,
48-
checkType: true
48+
checkType: false
4949
};
5050
if (req.body.isHasHeader == 'no') {
5151
headerRule.noheader = true;
5252
};
53-
if (projectType == PROJECTTYPE.TEXT) {
54-
headerRule.checkType = false;
53+
if (projectType == PROJECTTYPE.TABULAR) {
54+
headerRule.checkType = true;
5555
}
5656
let fileStream = await fileSystemUtils.handleFileStream(req.body.location);
5757

@@ -86,10 +86,10 @@ module.exports = {
8686
if (projectType == PROJECTTYPE.QA) {
8787
let questions = [];
8888
for (const q of questionForText) {
89-
if (!q || !q.trim() || !oneData[q]) {
89+
if (!`${q}`.trim() || !oneData[q].trim()) {
9090
continue;
9191
}
92-
for (const question of oneData[q].split("?")) {
92+
for (const question of oneData[q].trim().split("?")) {
9393
if (question.trim()) {
9494
questions.push(question.trim()+"?");
9595
}
@@ -205,4 +205,4 @@ module.exports = {
205205
}
206206
}
207207

208-
}
208+
}

0 commit comments

Comments
 (0)