Restructured in preparation for packaging
This commit is contained in:
parent
d6c0130477
commit
80a62a6e32
@ -57,7 +57,7 @@ class TokenClassificationTrainer:
|
|||||||
)
|
)
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
for i, label in enumerate(examples[f"ner_tags"]):
|
for i, label in enumerate(examples["ner_tags"]):
|
||||||
word_ids = tokenized_inputs.word_ids(
|
word_ids = tokenized_inputs.word_ids(
|
||||||
batch_index=i
|
batch_index=i
|
||||||
) # Map tokens to their respective word.
|
) # Map tokens to their respective word.
|
||||||
@ -100,7 +100,7 @@ class TokenClassificationTrainer:
|
|||||||
results: dict[str, float] = self._evaluator.compute(
|
results: dict[str, float] = self._evaluator.compute(
|
||||||
predictions=true_predictions, references=true_labels
|
predictions=true_predictions, references=true_labels
|
||||||
) # type: ignore
|
) # type: ignore
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"precision": results["overall_precision"],
|
"precision": results["overall_precision"],
|
||||||
"recall": results["overall_recall"],
|
"recall": results["overall_recall"],
|
Reference in New Issue
Block a user