Browse Source

Set default value to IntentDetectionSlotFillingRepository

pull/1764/head
Hironsan 3 years ago
parent
commit
a57f38d9de
2 changed files with 5 additions and 2 deletions
  1. 3
      backend/data_export/pipeline/repositories.py
  2. 4
      backend/data_export/tests/test_repositories.py

3
backend/data_export/pipeline/repositories.py

@ -201,4 +201,7 @@ class IntentDetectionSlotFillingRepository(TextRepository):
label_per_user[user]["cats"] = cats
for user, span in span_per_user.items():
label_per_user[user]["entities"] = span
for label in label_per_user.values():
label.setdefault("cats", [])
label.setdefault("entities", [])
return label_per_user

4
backend/data_export/tests/test_repositories.py

@ -77,7 +77,7 @@ class TestSequenceLabelingRepository(TestRepository):
def test_list(self):
project = prepare_project(SEQUENCE_LABELING)
repository = SequenceLabelingRepository(project)
repository = SequenceLabelingRepository(project.item)
self.prepare_data(project)
expected = [
{
@ -95,7 +95,7 @@ class TestSequenceLabelingRepository(TestRepository):
def test_list_on_collaborative_annotation(self):
project = prepare_project(SEQUENCE_LABELING, collaborative_annotation=True)
repository = SequenceLabelingRepository(project)
repository = SequenceLabelingRepository(project.item)
self.prepare_data(project)
expected = [
{

Loading…
Cancel
Save