Skip to content
Snippets Groups Projects

Add a message to assertion errors

Merged Manon Blanco requested to merge assertion-message into master
2 files
+ 14
10
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 7
7
@@ -58,10 +58,10 @@ def compute_matches(
Output : {TAG1 : nb_entity_matched, ...}, example : {'All': 1, 'OCC': 0, 'PER': 1}
"""
assert annotation
assert prediction
assert labels_annot
assert labels_predict
assert annotation, "Annotation is empty"
assert prediction, "Prediction is empty"
assert labels_annot, "Annotation labels are empty"
assert labels_predict, "Prediction labels are empty"
entity_count = {"All": 0}
last_tag = NOT_ENTITY_TAG
@@ -190,9 +190,9 @@ def get_labels_aligned(original: str, aligned: str, labels_original: list) -> li
Output format :
list of strings
"""
assert original
assert aligned
assert labels_original
assert original, "Original is empty"
assert aligned, "Aligned is empty"
assert labels_original, "Original labels are empty"
labels_aligned = []
index_original = 0
Loading