arkindex-base-worker 0.3.7rc4__py3-none-any.whl → 0.3.7rc5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arkindex-base-worker
3
- Version: 0.3.7rc4
3
+ Version: 0.3.7rc5
4
4
  Summary: Base Worker to easily build Arkindex ML workflows
5
5
  Author-email: Teklia <contact@teklia.com>
6
6
  Maintainer-email: Teklia <contact@teklia.com>
@@ -5,7 +5,7 @@ arkindex_worker/models.py,sha256=HdKFw3qk4WIWC-DrHDkhsw0mHP3OILuCLFf7aTjruZU,952
5
5
  arkindex_worker/utils.py,sha256=VSO8c21nsSaUCkyJaFX8wOwDQ0tztLOBFtiGvqlT0zU,6900
6
6
  arkindex_worker/worker/__init__.py,sha256=I8QmdAs659SalxNjtCu2K2ItdyUlXYm3mK_WhZdjgBs,19498
7
7
  arkindex_worker/worker/base.py,sha256=7ii3rZai6IB0-eB0TJ6pg-IhxMmW4izoJAKJKczbyZ4,19934
8
- arkindex_worker/worker/classification.py,sha256=0OiwxV9lb97Zs3kODm3hzyk0V7IxBTiW5SL6AYgRH1M,10351
8
+ arkindex_worker/worker/classification.py,sha256=JVz-6YEeuavOy7zGfQi4nE_wpj9hwMUZDXTem-hXQY8,10328
9
9
  arkindex_worker/worker/dataset.py,sha256=qzjaXJtfeNCP2acsHbqp5tjQk-KpLHwVzjDAExeAmVg,3228
10
10
  arkindex_worker/worker/element.py,sha256=AWK3YJSHWy3j4ajntJloi_2X4zxsgXZ6c6dzphgq3OI,33848
11
11
  arkindex_worker/worker/entity.py,sha256=YT2Ttdn-L5TRoDdhOI3Z4GE1vtkWl7tKZqbYrtxZ2Ug,14630
@@ -24,7 +24,7 @@ tests/test_image.py,sha256=FZv8njLxh45sVgmY71UFHt0lv1cHr0cK4rrtPhQleX8,16262
24
24
  tests/test_merge.py,sha256=Q4zCbtZbe0wBfqE56gvAD06c6pDuhqnjKaioFqIgAQw,8331
25
25
  tests/test_utils.py,sha256=pFXegcBvIuy1tJDDSgQtCbC_tRaoLjd2055R5lu3hS0,1236
26
26
  tests/test_elements_worker/__init__.py,sha256=Fh4nkbbyJSMv_VtjQxnWrOqTnxXaaWI8S9WU0VrzCHs,179
27
- tests/test_elements_worker/test_classifications.py,sha256=PE88fsdra8QsWcKjSyao-pTHlaIWNxlbfF0CrLe9LBA,26517
27
+ tests/test_elements_worker/test_classifications.py,sha256=vU6al1THtDSmERyVscMXaqiRPwTllcpRUHyeyBQ8M9U,26417
28
28
  tests/test_elements_worker/test_cli.py,sha256=BsFTswLti63WAZ2pf6ipiZKWJJyCQuSfuKnSlESuK8g,2878
29
29
  tests/test_elements_worker/test_dataset.py,sha256=-kVll1NcMPWkIx8D7r-Z5neEGkFiZ9YQfC4eTMIfjg0,13475
30
30
  tests/test_elements_worker/test_elements.py,sha256=6XKtgXSVQJnTSgTHWwEVsAtIwLBapjYjUYPUdjxcHsY,84971
@@ -34,8 +34,8 @@ tests/test_elements_worker/test_task.py,sha256=FCpxE9UpouKXgjGvWgNHEai_Hiy2d1Ymq
34
34
  tests/test_elements_worker/test_training.py,sha256=WeG-cDuJ-YhPgfKH47TtXBxyargtLuk7c8tsik2WnL8,8414
35
35
  tests/test_elements_worker/test_transcriptions.py,sha256=WVJG26sZyY66fu-Eka9A1_WWIeNI2scogjypzURnp8A,73468
36
36
  tests/test_elements_worker/test_worker.py,sha256=7-jGJVT3yMGpIyN96Uafz5eIUrO4ieNLgw0k1D8BhGc,17163
37
- arkindex_base_worker-0.3.7rc4.dist-info/LICENSE,sha256=NVshRi1efwVezMfW7xXYLrdDr2Li1AfwfGOd5WuH1kQ,1063
38
- arkindex_base_worker-0.3.7rc4.dist-info/METADATA,sha256=ilh4IdFYSXepgr0imEMH3ZbewlFJlbg97VKnvhKXMVQ,3411
39
- arkindex_base_worker-0.3.7rc4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
40
- arkindex_base_worker-0.3.7rc4.dist-info/top_level.txt,sha256=TtagLI8LSv7GE7nG8MQqDFAJ5bNDPJn7Z5vizOgrWkA,22
41
- arkindex_base_worker-0.3.7rc4.dist-info/RECORD,,
37
+ arkindex_base_worker-0.3.7rc5.dist-info/LICENSE,sha256=NVshRi1efwVezMfW7xXYLrdDr2Li1AfwfGOd5WuH1kQ,1063
38
+ arkindex_base_worker-0.3.7rc5.dist-info/METADATA,sha256=5i7tDRQVCiM4oo8mc0F8X_wsdSvr-mlqjmjhHHAmbNc,3411
39
+ arkindex_base_worker-0.3.7rc5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
40
+ arkindex_base_worker-0.3.7rc5.dist-info/top_level.txt,sha256=TtagLI8LSv7GE7nG8MQqDFAJ5bNDPJn7Z5vizOgrWkA,22
41
+ arkindex_base_worker-0.3.7rc5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -2,8 +2,6 @@
2
2
  ElementsWorker methods for classifications and ML classes.
3
3
  """
4
4
 
5
- from uuid import UUID
6
-
7
5
  from apistar.exceptions import ErrorResponse
8
6
  from peewee import IntegrityError
9
7
 
@@ -178,10 +176,14 @@ class ClassificationMixin:
178
176
  Create multiple classifications at once on the given element through the API.
179
177
 
180
178
  :param element: The element to create classifications on.
181
- :param classifications: The classifications to create, a list of dicts. Each of them contains
182
- a **ml_class_id** (str), the ID of the MLClass for this classification;
183
- a **confidence** (float), the confidence score, between 0 and 1;
184
- a **high_confidence** (bool), the high confidence state of the classification.
179
+ :param classifications: A list of dicts representing a classification each, with the following keys:
180
+
181
+ ml_class (str)
182
+ Required. Name of the MLClass to use.
183
+ confidence (float)
184
+ Required. Confidence score for the classification. Must be between 0 and 1.
185
+ high_confidence (bool)
186
+ Optional. Whether or not the classification is of high confidence.
185
187
 
186
188
  :returns: List of created classifications, as returned in the ``classifications`` field by
187
189
  the ``CreateClassifications`` API endpoint.
@@ -194,18 +196,10 @@ class ClassificationMixin:
194
196
  ), "classifications shouldn't be null and should be of type list"
195
197
 
196
198
  for index, classification in enumerate(classifications):
197
- ml_class_id = classification.get("ml_class_id")
199
+ ml_class = classification.get("ml_class")
198
200
  assert (
199
- ml_class_id and isinstance(ml_class_id, str)
200
- ), f"Classification at index {index} in classifications: ml_class_id shouldn't be null and should be of type str"
201
-
202
- # Make sure it's a valid UUID
203
- try:
204
- UUID(ml_class_id)
205
- except ValueError as e:
206
- raise ValueError(
207
- f"Classification at index {index} in classifications: ml_class_id is not a valid uuid."
208
- ) from e
201
+ ml_class and isinstance(ml_class, str)
202
+ ), f"Classification at index {index} in classifications: ml_class shouldn't be null and should be of type str"
209
203
 
210
204
  confidence = classification.get("confidence")
211
205
  assert (
@@ -231,7 +225,13 @@ class ClassificationMixin:
231
225
  body={
232
226
  "parent": str(element.id),
233
227
  "worker_run_id": self.worker_run_id,
234
- "classifications": classifications,
228
+ "classifications": [
229
+ {
230
+ **classification,
231
+ "ml_class": self.get_ml_class_id(classification["ml_class"]),
232
+ }
233
+ for classification in classifications
234
+ ],
235
235
  },
236
236
  )["classifications"]
237
237
 
@@ -1,6 +1,6 @@
1
1
  import json
2
2
  import re
3
- from uuid import UUID, uuid4
3
+ from uuid import UUID
4
4
 
5
5
  import pytest
6
6
  from apistar.exceptions import ErrorResponse
@@ -325,9 +325,6 @@ def test_create_classification_create_ml_class(mock_elements_worker, responses):
325
325
  )
326
326
 
327
327
  # Check a class & classification has been created
328
- for call in responses.calls:
329
- print(call.request.url, call.request.body)
330
-
331
328
  assert [
332
329
  (call.request.url, json.loads(call.request.body))
333
330
  for call in responses.calls[-2:]
@@ -506,12 +503,12 @@ def test_create_classifications_wrong_data(
506
503
  "element": Element({"id": "12341234-1234-1234-1234-123412341234"}),
507
504
  "classifications": [
508
505
  {
509
- "ml_class_id": "uuid1",
506
+ "ml_class": "cat",
510
507
  "confidence": 0.75,
511
508
  "high_confidence": False,
512
509
  },
513
510
  {
514
- "ml_class_id": "uuid2",
511
+ "ml_class": "dog",
515
512
  "confidence": 0.25,
516
513
  "high_confidence": False,
517
514
  },
@@ -523,86 +520,71 @@ def test_create_classifications_wrong_data(
523
520
 
524
521
 
525
522
  @pytest.mark.parametrize(
526
- ("arg_name", "data", "error_message", "error_type"),
523
+ ("arg_name", "data", "error_message"),
527
524
  [
528
- # Wrong classifications > ml_class_id
525
+ # Wrong classifications > ml_class
529
526
  (
530
- "ml_class_id",
527
+ "ml_class",
531
528
  DELETE_PARAMETER,
532
- "ml_class_id shouldn't be null and should be of type str",
533
- AssertionError,
534
- ), # Updated
529
+ "ml_class shouldn't be null and should be of type str",
530
+ ),
535
531
  (
536
- "ml_class_id",
532
+ "ml_class",
537
533
  None,
538
- "ml_class_id shouldn't be null and should be of type str",
539
- AssertionError,
534
+ "ml_class shouldn't be null and should be of type str",
540
535
  ),
541
536
  (
542
- "ml_class_id",
537
+ "ml_class",
543
538
  1234,
544
- "ml_class_id shouldn't be null and should be of type str",
545
- AssertionError,
546
- ),
547
- (
548
- "ml_class_id",
549
- "not_an_uuid",
550
- "ml_class_id is not a valid uuid.",
551
- ValueError,
539
+ "ml_class shouldn't be null and should be of type str",
552
540
  ),
553
541
  # Wrong classifications > confidence
554
542
  (
555
543
  "confidence",
556
544
  DELETE_PARAMETER,
557
545
  "confidence shouldn't be null and should be a float in [0..1] range",
558
- AssertionError,
559
546
  ),
560
547
  (
561
548
  "confidence",
562
549
  None,
563
550
  "confidence shouldn't be null and should be a float in [0..1] range",
564
- AssertionError,
565
551
  ),
566
552
  (
567
553
  "confidence",
568
554
  "wrong confidence",
569
555
  "confidence shouldn't be null and should be a float in [0..1] range",
570
- AssertionError,
571
556
  ),
572
557
  (
573
558
  "confidence",
574
559
  0,
575
560
  "confidence shouldn't be null and should be a float in [0..1] range",
576
- AssertionError,
577
561
  ),
578
562
  (
579
563
  "confidence",
580
564
  2.00,
581
565
  "confidence shouldn't be null and should be a float in [0..1] range",
582
- AssertionError,
583
566
  ),
584
567
  # Wrong classifications > high_confidence
585
568
  (
586
569
  "high_confidence",
587
570
  "wrong high_confidence",
588
571
  "high_confidence should be of type bool",
589
- AssertionError,
590
572
  ),
591
573
  ],
592
574
  )
593
575
  def test_create_classifications_wrong_classifications_data(
594
- arg_name, data, error_message, error_type, mock_elements_worker
576
+ arg_name, data, error_message, mock_elements_worker
595
577
  ):
596
578
  all_data = {
597
579
  "element": Element({"id": "12341234-1234-1234-1234-123412341234"}),
598
580
  "classifications": [
599
581
  {
600
- "ml_class_id": str(uuid4()),
582
+ "ml_class": "cat",
601
583
  "confidence": 0.75,
602
584
  "high_confidence": False,
603
585
  },
604
586
  {
605
- "ml_class_id": str(uuid4()),
587
+ "ml_class": "dog",
606
588
  "confidence": 0.25,
607
589
  "high_confidence": False,
608
590
  # Overwrite with wrong data
@@ -614,7 +596,7 @@ def test_create_classifications_wrong_classifications_data(
614
596
  del all_data["classifications"][1][arg_name]
615
597
 
616
598
  with pytest.raises(
617
- error_type,
599
+ AssertionError,
618
600
  match=re.escape(
619
601
  f"Classification at index 1 in classifications: {error_message}"
620
602
  ),
@@ -623,6 +605,7 @@ def test_create_classifications_wrong_classifications_data(
623
605
 
624
606
 
625
607
  def test_create_classifications_api_error(responses, mock_elements_worker):
608
+ mock_elements_worker.classes = {"cat": "0000", "dog": "1111"}
626
609
  responses.add(
627
610
  responses.POST,
628
611
  "http://testserver/api/v1/classification/bulk/",
@@ -631,12 +614,12 @@ def test_create_classifications_api_error(responses, mock_elements_worker):
631
614
  elt = Element({"id": "12341234-1234-1234-1234-123412341234"})
632
615
  classes = [
633
616
  {
634
- "ml_class_id": str(uuid4()),
617
+ "ml_class": "cat",
635
618
  "confidence": 0.75,
636
619
  "high_confidence": False,
637
620
  },
638
621
  {
639
- "ml_class_id": str(uuid4()),
622
+ "ml_class": "dog",
640
623
  "confidence": 0.25,
641
624
  "high_confidence": False,
642
625
  },
@@ -660,57 +643,96 @@ def test_create_classifications_api_error(responses, mock_elements_worker):
660
643
  ]
661
644
 
662
645
 
663
- def test_create_classifications(responses, mock_elements_worker_with_cache):
664
- # Set MLClass in cache
665
- portrait_uuid = str(uuid4())
666
- landscape_uuid = str(uuid4())
667
- mock_elements_worker_with_cache.classes = {
668
- "portrait": portrait_uuid,
669
- "landscape": landscape_uuid,
670
- }
671
-
672
- elt = CachedElement.create(id="12341234-1234-1234-1234-123412341234", type="thing")
673
- classes = [
674
- {
675
- "ml_class_id": portrait_uuid,
676
- "confidence": 0.75,
677
- "high_confidence": False,
678
- },
679
- {
680
- "ml_class_id": landscape_uuid,
681
- "confidence": 0.25,
682
- "high_confidence": False,
683
- },
684
- ]
646
+ def test_create_classifications_create_ml_class(mock_elements_worker, responses):
647
+ elt = Element({"id": "12341234-1234-1234-1234-123412341234"})
685
648
 
649
+ # Automatically create a missing class!
650
+ responses.add(
651
+ responses.POST,
652
+ "http://testserver/api/v1/corpus/11111111-1111-1111-1111-111111111111/classes/",
653
+ status=201,
654
+ json={"id": "new-ml-class-1234"},
655
+ )
686
656
  responses.add(
687
657
  responses.POST,
688
658
  "http://testserver/api/v1/classification/bulk/",
689
- status=200,
659
+ status=201,
690
660
  json={
691
661
  "parent": str(elt.id),
692
662
  "worker_run_id": "56785678-5678-5678-5678-567856785678",
693
663
  "classifications": [
694
664
  {
695
665
  "id": "00000000-0000-0000-0000-000000000000",
696
- "ml_class": portrait_uuid,
666
+ "ml_class": "new-ml-class-1234",
697
667
  "confidence": 0.75,
698
668
  "high_confidence": False,
699
669
  "state": "pending",
700
670
  },
701
- {
702
- "id": "11111111-1111-1111-1111-111111111111",
703
- "ml_class": landscape_uuid,
704
- "confidence": 0.25,
705
- "high_confidence": False,
706
- "state": "pending",
707
- },
708
671
  ],
709
672
  },
710
673
  )
674
+ mock_elements_worker.classes = {"another_class": "0000"}
675
+ mock_elements_worker.create_classifications(
676
+ element=elt,
677
+ classifications=[
678
+ {
679
+ "ml_class": "a_class",
680
+ "confidence": 0.75,
681
+ "high_confidence": False,
682
+ }
683
+ ],
684
+ )
711
685
 
712
- mock_elements_worker_with_cache.create_classifications(
713
- element=elt, classifications=classes
686
+ # Check a class & classification has been created
687
+ assert len(responses.calls) == len(BASE_API_CALLS) + 2
688
+ assert [
689
+ (call.request.method, call.request.url) for call in responses.calls
690
+ ] == BASE_API_CALLS + [
691
+ (
692
+ "POST",
693
+ "http://testserver/api/v1/corpus/11111111-1111-1111-1111-111111111111/classes/",
694
+ ),
695
+ ("POST", "http://testserver/api/v1/classification/bulk/"),
696
+ ]
697
+
698
+ assert json.loads(responses.calls[-2].request.body) == {"name": "a_class"}
699
+ assert json.loads(responses.calls[-1].request.body) == {
700
+ "parent": "12341234-1234-1234-1234-123412341234",
701
+ "worker_run_id": "56785678-5678-5678-5678-567856785678",
702
+ "classifications": [
703
+ {
704
+ "ml_class": "new-ml-class-1234",
705
+ "confidence": 0.75,
706
+ "high_confidence": False,
707
+ }
708
+ ],
709
+ }
710
+
711
+
712
+ def test_create_classifications(responses, mock_elements_worker):
713
+ mock_elements_worker.classes = {"portrait": "0000", "landscape": "1111"}
714
+ elt = Element({"id": "12341234-1234-1234-1234-123412341234"})
715
+ responses.add(
716
+ responses.POST,
717
+ "http://testserver/api/v1/classification/bulk/",
718
+ status=200,
719
+ json={"classifications": []},
720
+ )
721
+
722
+ mock_elements_worker.create_classifications(
723
+ element=elt,
724
+ classifications=[
725
+ {
726
+ "ml_class": "portrait",
727
+ "confidence": 0.75,
728
+ "high_confidence": False,
729
+ },
730
+ {
731
+ "ml_class": "landscape",
732
+ "confidence": 0.25,
733
+ "high_confidence": False,
734
+ },
735
+ ],
714
736
  )
715
737
 
716
738
  assert len(responses.calls) == len(BASE_API_CALLS) + 1
@@ -723,52 +745,24 @@ def test_create_classifications(responses, mock_elements_worker_with_cache):
723
745
  assert json.loads(responses.calls[-1].request.body) == {
724
746
  "parent": str(elt.id),
725
747
  "worker_run_id": "56785678-5678-5678-5678-567856785678",
726
- "classifications": classes,
748
+ "classifications": [
749
+ {
750
+ "confidence": 0.75,
751
+ "high_confidence": False,
752
+ "ml_class": "0000",
753
+ },
754
+ {
755
+ "confidence": 0.25,
756
+ "high_confidence": False,
757
+ "ml_class": "1111",
758
+ },
759
+ ],
727
760
  }
728
761
 
729
- # Check that created classifications were properly stored in SQLite cache
730
- assert list(CachedClassification.select()) == [
731
- CachedClassification(
732
- id=UUID("00000000-0000-0000-0000-000000000000"),
733
- element_id=UUID(elt.id),
734
- class_name="portrait",
735
- confidence=0.75,
736
- state="pending",
737
- worker_run_id=UUID("56785678-5678-5678-5678-567856785678"),
738
- ),
739
- CachedClassification(
740
- id=UUID("11111111-1111-1111-1111-111111111111"),
741
- element_id=UUID(elt.id),
742
- class_name="landscape",
743
- confidence=0.25,
744
- state="pending",
745
- worker_run_id=UUID("56785678-5678-5678-5678-567856785678"),
746
- ),
747
- ]
748
-
749
762
 
750
- def test_create_classifications_not_in_cache(
751
- responses, mock_elements_worker_with_cache
752
- ):
753
- """
754
- CreateClassifications using ID that are not in `.classes` attribute.
755
- Will load corpus MLClass to insert the corresponding name in Cache.
756
- """
757
- portrait_uuid = str(uuid4())
758
- landscape_uuid = str(uuid4())
763
+ def test_create_classifications_with_cache(responses, mock_elements_worker_with_cache):
764
+ mock_elements_worker_with_cache.classes = {"portrait": "0000", "landscape": "1111"}
759
765
  elt = CachedElement.create(id="12341234-1234-1234-1234-123412341234", type="thing")
760
- classes = [
761
- {
762
- "ml_class_id": portrait_uuid,
763
- "confidence": 0.75,
764
- "high_confidence": False,
765
- },
766
- {
767
- "ml_class_id": landscape_uuid,
768
- "confidence": 0.25,
769
- "high_confidence": False,
770
- },
771
- ]
772
766
 
773
767
  responses.add(
774
768
  responses.POST,
@@ -780,14 +774,14 @@ def test_create_classifications_not_in_cache(
780
774
  "classifications": [
781
775
  {
782
776
  "id": "00000000-0000-0000-0000-000000000000",
783
- "ml_class": portrait_uuid,
777
+ "ml_class": "0000",
784
778
  "confidence": 0.75,
785
779
  "high_confidence": False,
786
780
  "state": "pending",
787
781
  },
788
782
  {
789
783
  "id": "11111111-1111-1111-1111-111111111111",
790
- "ml_class": landscape_uuid,
784
+ "ml_class": "1111",
791
785
  "confidence": 0.25,
792
786
  "high_confidence": False,
793
787
  "state": "pending",
@@ -795,42 +789,45 @@ def test_create_classifications_not_in_cache(
795
789
  ],
796
790
  },
797
791
  )
798
- responses.add(
799
- responses.GET,
800
- f"http://testserver/api/v1/corpus/{mock_elements_worker_with_cache.corpus_id}/classes/",
801
- status=200,
802
- json={
803
- "count": 2,
804
- "next": None,
805
- "results": [
806
- {
807
- "id": portrait_uuid,
808
- "name": "portrait",
809
- },
810
- {"id": landscape_uuid, "name": "landscape"},
811
- ],
812
- },
813
- )
814
792
 
815
793
  mock_elements_worker_with_cache.create_classifications(
816
- element=elt, classifications=classes
794
+ element=elt,
795
+ classifications=[
796
+ {
797
+ "ml_class": "portrait",
798
+ "confidence": 0.75,
799
+ "high_confidence": False,
800
+ },
801
+ {
802
+ "ml_class": "landscape",
803
+ "confidence": 0.25,
804
+ "high_confidence": False,
805
+ },
806
+ ],
817
807
  )
818
808
 
819
- assert len(responses.calls) == len(BASE_API_CALLS) + 2
809
+ assert len(responses.calls) == len(BASE_API_CALLS) + 1
820
810
  assert [
821
811
  (call.request.method, call.request.url) for call in responses.calls
822
812
  ] == BASE_API_CALLS + [
823
813
  ("POST", "http://testserver/api/v1/classification/bulk/"),
824
- (
825
- "GET",
826
- f"http://testserver/api/v1/corpus/{mock_elements_worker_with_cache.corpus_id}/classes/",
827
- ),
828
814
  ]
829
815
 
830
- assert json.loads(responses.calls[-2].request.body) == {
816
+ assert json.loads(responses.calls[-1].request.body) == {
831
817
  "parent": str(elt.id),
832
818
  "worker_run_id": "56785678-5678-5678-5678-567856785678",
833
- "classifications": classes,
819
+ "classifications": [
820
+ {
821
+ "confidence": 0.75,
822
+ "high_confidence": False,
823
+ "ml_class": "0000",
824
+ },
825
+ {
826
+ "confidence": 0.25,
827
+ "high_confidence": False,
828
+ "ml_class": "1111",
829
+ },
830
+ ],
834
831
  }
835
832
 
836
833
  # Check that created classifications were properly stored in SQLite cache