@@ -113,7 +113,7 @@ def test_prediction_token_based_evaluation_all_matching(self):
113
113
dataset = get_dataset (gt , sentences )
114
114
115
115
custom_evaluator = ZeroShotTokenClassificationEvaluator ("token-classification" )
116
- metrics = custom_evaluator .compute (get_linker_pipe ([('New York' , 'FAC' , 1 )]), dataset , "seqeval" )
116
+ metrics = custom_evaluator .compute (get_linker_pipe ([('New York' , 'FAC' , 1 )]), dataset , metric = "seqeval" )
117
117
118
118
assert float (metrics ["overall_precision" ]) == 1.0
119
119
assert float (metrics ["overall_precision" ]) == 1.0
@@ -128,7 +128,7 @@ def test_prediction_token_based_evaluation_overlapping_spans(self):
128
128
129
129
custom_evaluator = ZeroShotTokenClassificationEvaluator ("token-classification" )
130
130
metrics = custom_evaluator .compute (get_linker_pipe ([('New York' , 'FAC' , 1 ), ('York' , 'LOC' , 0.7 )]), dataset ,
131
- "seqeval" )
131
+ metric = "seqeval" )
132
132
133
133
assert float (metrics ["overall_precision" ]) == 1.0
134
134
assert float (metrics ["overall_precision" ]) == 1.0
@@ -144,7 +144,7 @@ def test_prediction_token_based_evaluation_partial_match_spans_expand(self):
144
144
custom_evaluator = ZeroShotTokenClassificationEvaluator ("token-classification" ,
145
145
alignment_mode = AlignmentMode .expand )
146
146
pipe = get_linker_pipe ([('New Yo' , 'FAC' , 1 )])
147
- metrics = custom_evaluator .compute (pipe , dataset , "seqeval" )
147
+ metrics = custom_evaluator .compute (pipe , dataset , metric = "seqeval" )
148
148
149
149
assert float (metrics ["overall_precision" ]) == 1.0
150
150
assert float (metrics ["overall_precision" ]) == 1.0
@@ -160,7 +160,7 @@ def test_prediction_token_based_evaluation_partial_match_spans_contract(self):
160
160
custom_evaluator = ZeroShotTokenClassificationEvaluator ("token-classification" ,
161
161
alignment_mode = AlignmentMode .contract )
162
162
pipe = get_linker_pipe ([('New York i' , 'FAC' , 1 )])
163
- metrics = custom_evaluator .compute (pipe , dataset , "seqeval" )
163
+ metrics = custom_evaluator .compute (pipe , dataset , metric = "seqeval" )
164
164
165
165
assert float (metrics ["overall_precision" ]) == 1.0
166
166
assert float (metrics ["overall_precision" ]) == 1.0
@@ -176,7 +176,7 @@ def test_prediction_token_based_evaluation_partial_and_overlapping_spans(self):
176
176
custom_evaluator = ZeroShotTokenClassificationEvaluator ("token-classification" ,
177
177
alignment_mode = AlignmentMode .contract )
178
178
pipe = get_linker_pipe ([('New York i' , 'FAC' , 1 ), ('w York' , 'LOC' , 0.7 )])
179
- metrics = custom_evaluator .compute (pipe , dataset , "seqeval" )
179
+ metrics = custom_evaluator .compute (pipe , dataset , metric = "seqeval" )
180
180
181
181
assert float (metrics ["overall_precision" ]) == 1.0
182
182
assert float (metrics ["overall_precision" ]) == 1.0
@@ -207,7 +207,8 @@ def test_prediction_token_based_evaluation_all_matching(self):
207
207
dataset = get_dataset (gt , sentences )
208
208
209
209
custom_evaluator = MentionsExtractorEvaluator ("token-classification" )
210
- metrics = custom_evaluator .compute (get_mentions_extractor_pipe ([('New York' , 'FAC' , 1 )]), dataset , "seqeval" )
210
+ metrics = custom_evaluator .compute (get_mentions_extractor_pipe ([('New York' , 'FAC' , 1 )]), dataset ,
211
+ metric = "seqeval" )
211
212
212
213
assert float (metrics ["overall_precision" ]) == 1.0
213
214
assert float (metrics ["overall_precision" ]) == 1.0
@@ -222,7 +223,7 @@ def test_prediction_token_based_evaluation_overlapping_spans(self):
222
223
223
224
custom_evaluator = MentionsExtractorEvaluator ("token-classification" )
224
225
metrics = custom_evaluator .compute (get_mentions_extractor_pipe ([('New York' , 'FAC' , 1 ), ('York' , 'LOC' , 0.7 )]),
225
- dataset , "seqeval" )
226
+ dataset , metric = "seqeval" )
226
227
227
228
assert float (metrics ["overall_precision" ]) == 1.0
228
229
assert float (metrics ["overall_precision" ]) == 1.0
@@ -238,7 +239,7 @@ def test_prediction_token_based_evaluation_partial_match_spans_expand(self):
238
239
custom_evaluator = MentionsExtractorEvaluator ("token-classification" ,
239
240
alignment_mode = AlignmentMode .expand )
240
241
pipe = get_mentions_extractor_pipe ([('New Yo' , 'FAC' , 1 )])
241
- metrics = custom_evaluator .compute (pipe , dataset , "seqeval" )
242
+ metrics = custom_evaluator .compute (pipe , dataset , metric = "seqeval" )
242
243
243
244
assert float (metrics ["overall_precision" ]) == 1.0
244
245
assert float (metrics ["overall_precision" ]) == 1.0
0 commit comments