From f62df2fb6d01cc8432f6d937d002b29d5dfc1ba6 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Fri, 24 Dec 2021 10:03:02 +0900 Subject: [PATCH] Add a feature to create intent detection and slot filling project --- backend/api/serializers.py | 9 ++++++++- frontend/components/project/FormCreate.vue | 1 + frontend/domain/models/project/project.ts | 8 ++++++-- frontend/i18n/de/projects/overview.js | 1 + frontend/i18n/en/projects/overview.js | 1 + frontend/i18n/fr/projects/overview.js | 1 + frontend/i18n/zh/projects/overview.js | 1 + 7 files changed, 19 insertions(+), 3 deletions(-) diff --git a/backend/api/serializers.py b/backend/api/serializers.py index 82f4c820..0d597e08 100644 --- a/backend/api/serializers.py +++ b/backend/api/serializers.py @@ -9,7 +9,8 @@ from rest_polymorphic.serializers import PolymorphicSerializer from .models import (DOCUMENT_CLASSIFICATION, IMAGE_CLASSIFICATION, SEQ2SEQ, SEQUENCE_LABELING, SPEECH2TEXT, AnnotationRelations, AutoLabelingConfig, Category, Comment, DocType, Example, - ExampleState, ImageClassificationProject, Label, Project, + ExampleState, ImageClassificationProject, + IntentDetectionAndSlotFillingProject, Label, Project, RelationTypes, Role, RoleMapping, Seq2seqProject, SequenceLabelingProject, Span, SpanType, Speech2textProject, Tag, TextClassificationProject, @@ -223,6 +224,12 @@ class Seq2seqProjectSerializer(ProjectSerializer): model = Seq2seqProject +class IntentDetectionAndSlotFillingProjectSerializer(ProjectSerializer): + + class Meta(ProjectSerializer.Meta): + model = IntentDetectionAndSlotFillingProject + + class Speech2textProjectSerializer(ProjectSerializer): class Meta(ProjectSerializer.Meta): diff --git a/frontend/components/project/FormCreate.vue b/frontend/components/project/FormCreate.vue index 0078f976..c26e2329 100644 --- a/frontend/components/project/FormCreate.vue +++ b/frontend/components/project/FormCreate.vue @@ -171,6 +171,7 @@ export default Vue.extend({ 'DocumentClassification', 'SequenceLabeling', 'Seq2seq', + 'IntentDetectionAndSlotFilling', 'ImageClassification', 'Speech2text', ] diff --git a/frontend/domain/models/project/project.ts b/frontend/domain/models/project/project.ts index 08cff0c5..538bddd8 100644 --- a/frontend/domain/models/project/project.ts +++ b/frontend/domain/models/project/project.ts @@ -4,7 +4,7 @@ export interface CurrentUsersRole { is_annotation_approver: boolean; } -export type ProjectType = 'DocumentClassification' | 'SequenceLabeling' | 'Seq2seq' | 'ImageClassification' | 'Speech2text' +export type ProjectType = 'DocumentClassification' | 'SequenceLabeling' | 'Seq2seq' | 'IntentDetectionAndSlotFilling' | 'ImageClassification' | 'Speech2text' export class ProjectReadItem { @@ -86,6 +86,7 @@ export class ProjectReadItem { DocumentClassification: 'text-classification', SequenceLabeling : 'sequence-labeling', Seq2seq : 'sequence-to-sequence', + IntentDetectionAndSlotFilling: 'intent-detection-and-slot-filling', ImageClassification : 'image-classification', Speech2text : 'speech-to-text', } @@ -97,6 +98,7 @@ export class ProjectReadItem { const allowedProjectTypes = [ 'DocumentClassification', 'SequenceLabeling', + 'IntentDetectionAndSlotFilling', 'ImageClassification' ] return allowedProjectTypes.includes(this.project_type) @@ -113,7 +115,8 @@ export class ProjectReadItem { const allowedProjectTypes = [ 'DocumentClassification', 'SequenceLabeling', - 'Seq2seq' + 'Seq2seq', + 'IntentDetectionAndSlotFilling' ] return allowedProjectTypes.includes(this.project_type) } @@ -198,6 +201,7 @@ export class ProjectWriteItem { DocumentClassification: 'TextClassificationProject', SequenceLabeling : 'SequenceLabelingProject', Seq2seq : 'Seq2seqProject', + IntentDetectionAndSlotFilling: 'IntentDetectionAndSlotFillingProject', ImageClassification : 'ImageClassificationProject', Speech2text : 'Speech2textProject', } diff --git a/frontend/i18n/de/projects/overview.js b/frontend/i18n/de/projects/overview.js index f101fb69..e7cbd754 100644 --- a/frontend/i18n/de/projects/overview.js +++ b/frontend/i18n/de/projects/overview.js @@ -15,6 +15,7 @@ export default { 'Textklassifikation', 'Sequenz-Labeling', 'Sequenz zu Sequenz', + 'Intent-Erkennung und Slot-Füllung', 'Bildklassifikation', 'Sprache zu Text', ] diff --git a/frontend/i18n/en/projects/overview.js b/frontend/i18n/en/projects/overview.js index 263a6638..e56ce984 100644 --- a/frontend/i18n/en/projects/overview.js +++ b/frontend/i18n/en/projects/overview.js @@ -15,6 +15,7 @@ export default { 'Text Classification', 'Sequence Labeling', 'Sequence to sequence', + 'Intent Detection and Slot Filling', 'Image Classification', 'Speech to Text', ] diff --git a/frontend/i18n/fr/projects/overview.js b/frontend/i18n/fr/projects/overview.js index 2fa37c2c..a3179ad8 100644 --- a/frontend/i18n/fr/projects/overview.js +++ b/frontend/i18n/fr/projects/overview.js @@ -13,6 +13,7 @@ export default { 'Classification des textes', 'Étiquetage des séquences', 'Séquence à séquence', + 'Détection d\'intention et remplissage d\'emplacements', 'Classification d\'images', 'De la parole au texte', ] diff --git a/frontend/i18n/zh/projects/overview.js b/frontend/i18n/zh/projects/overview.js index 8f44854d..f8c5878d 100644 --- a/frontend/i18n/zh/projects/overview.js +++ b/frontend/i18n/zh/projects/overview.js @@ -15,6 +15,7 @@ export default { '文本分类', '序列标注', '序列到序列', + '意图检测和槽填充', '图像分类', '文字转语音' ]