Browse Source

Add a project for intent detection and slot filling

pull/1619/head
Hironsan 2 years ago
parent
commit
c51d600a3d
2 changed files with 38 additions and 0 deletions
  1. 30
      backend/api/migrations/0025_auto_20211222_0454.py
  2. 8
      backend/api/models.py

30
backend/api/migrations/0025_auto_20211222_0454.py

@ -0,0 +1,30 @@
# Generated by Django 3.2.8 on 2021-12-22 04:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0024_auto_20211221_1444'),
]
operations = [
migrations.CreateModel(
name='IntentDetectionAndSlotFillingProject',
fields=[
('project_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='api.project')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('api.project',),
),
migrations.AlterField(
model_name='project',
name='project_type',
field=models.CharField(choices=[('DocumentClassification', 'document classification'), ('SequenceLabeling', 'sequence labeling'), ('Seq2seq', 'sequence to sequence'), ('IntentDetectionAndSlotFilling', 'intent detection and slot filling'), ('Speech2text', 'speech to text'), ('ImageClassification', 'image classification')], max_length=30),
),
]

8
backend/api/models.py

@ -17,10 +17,12 @@ SEQUENCE_LABELING = 'SequenceLabeling'
SEQ2SEQ = 'Seq2seq'
SPEECH2TEXT = 'Speech2text'
IMAGE_CLASSIFICATION = 'ImageClassification'
INTENT_DETECTION_AND_SLOT_FILLING = 'IntentDetectionAndSlotFilling'
PROJECT_CHOICES = (
(DOCUMENT_CLASSIFICATION, 'document classification'),
(SEQUENCE_LABELING, 'sequence labeling'),
(SEQ2SEQ, 'sequence to sequence'),
(INTENT_DETECTION_AND_SLOT_FILLING, 'intent detection and slot filling'),
(SPEECH2TEXT, 'speech to text'),
(IMAGE_CLASSIFICATION, 'image classification')
)
@ -65,6 +67,12 @@ class Seq2seqProject(Project):
return task == 'text'
class IntentDetectionAndSlotFillingProject(Project):
def is_task_of(self, task: Literal['text', 'image', 'speech']):
return task == 'text'
class Speech2textProject(Project):
def is_task_of(self, task: Literal['text', 'image', 'speech']):

Loading…
Cancel
Save