adding files with labels post wiesp
Browse files- FOCAL-TESTING-NO-LABELS.jsonl +0 -0
- FOCAL-TESTING.jsonl +0 -0
- FOCAL-VALIDATION.jsonl +0 -0
- scoring_scripts/score_focal_seqeval.py +5 -3
FOCAL-TESTING-NO-LABELS.jsonl
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
FOCAL-TESTING.jsonl
ADDED
The diff for this file is too large to render.
See raw diff
|
|
FOCAL-VALIDATION.jsonl
ADDED
The diff for this file is too large to render.
See raw diff
|
|
scoring_scripts/score_focal_seqeval.py
CHANGED
@@ -32,7 +32,7 @@ def evaluate_FOCAL_seqeval(references_jsonl, predictions_jsonl, print_reports=Fa
|
|
32 |
ref_functions_labels = [e['Functions Label'] for e in references_jsonl]
|
33 |
ref_functions_start_end = [e['Functions Start End'] for e in references_jsonl]
|
34 |
ref_paragraphs = [e['Paragraph'] for e in references_jsonl]
|
35 |
-
|
36 |
pred_functions_texts = [e['Functions Text'] for e in predictions_jsonl]
|
37 |
pred_functions_labels = [e['Functions Label'] for e in predictions_jsonl]
|
38 |
pred_functions_start_end = [e['Functions Start End'] for e in predictions_jsonl]
|
@@ -57,7 +57,8 @@ def evaluate_FOCAL_seqeval(references_jsonl, predictions_jsonl, print_reports=Fa
|
|
57 |
# go through each ref function to verify the data
|
58 |
for j,(start,end) in enumerate(ref_functions_start_end[i]):
|
59 |
# check that the text of the ref function matches the paragraph [start:end] section defined by the ref's start:end
|
60 |
-
|
|
|
61 |
|
62 |
# fill in the char level labels
|
63 |
ref_labels_char[start] = 'B-'+ ref_functions_labels[i][j]
|
@@ -68,7 +69,8 @@ def evaluate_FOCAL_seqeval(references_jsonl, predictions_jsonl, print_reports=Fa
|
|
68 |
# do the same for the pred functions
|
69 |
for j,(start,end) in enumerate(pred_functions_start_end[i]):
|
70 |
# check that the text of the pred function matches the paragraph [start:end] section defined by the pred's start:end
|
71 |
-
|
|
|
72 |
|
73 |
# fill in the char level labels
|
74 |
pred_labels_char[start] = 'B-'+ pred_functions_labels[i][j]
|
|
|
32 |
ref_functions_labels = [e['Functions Label'] for e in references_jsonl]
|
33 |
ref_functions_start_end = [e['Functions Start End'] for e in references_jsonl]
|
34 |
ref_paragraphs = [e['Paragraph'] for e in references_jsonl]
|
35 |
+
|
36 |
pred_functions_texts = [e['Functions Text'] for e in predictions_jsonl]
|
37 |
pred_functions_labels = [e['Functions Label'] for e in predictions_jsonl]
|
38 |
pred_functions_start_end = [e['Functions Start End'] for e in predictions_jsonl]
|
|
|
57 |
# go through each ref function to verify the data
|
58 |
for j,(start,end) in enumerate(ref_functions_start_end[i]):
|
59 |
# check that the text of the ref function matches the paragraph [start:end] section defined by the ref's start:end
|
60 |
+
assert_err_string = 'ref function text doesnt match paragraph[start:end]:\nID:{} {}\nfunction text: {}\nparagraph[start:end]:{}'.format(i, references_jsonl[i]['Identifier'], ref_functions_texts[i][j], p[start:end])
|
61 |
+
assert p[start:end]==ref_functions_texts[i][j], assert_err_string
|
62 |
|
63 |
# fill in the char level labels
|
64 |
ref_labels_char[start] = 'B-'+ ref_functions_labels[i][j]
|
|
|
69 |
# do the same for the pred functions
|
70 |
for j,(start,end) in enumerate(pred_functions_start_end[i]):
|
71 |
# check that the text of the pred function matches the paragraph [start:end] section defined by the pred's start:end
|
72 |
+
assert_err_string = 'pred function text doesnt match paragraph[start:end]:\nID:{} {}\nfunction text: {}\nparagraph[start:end]:{}'.format(i, predictions_jsonl[i]['Identifier'], pred_functions_texts[i][j], p[start:end])
|
73 |
+
assert p[start:end]==pred_functions_texts[i][j], assert_err_string
|
74 |
|
75 |
# fill in the char level labels
|
76 |
pred_labels_char[start] = 'B-'+ pred_functions_labels[i][j]
|