Migrate metric to Evaluate library for tensorflow examples (#18327)

* Migrate metric to Evaluate library in tf examples

Currently tensorflow examples use `load_metric` function from Datasets
library , commit migrates function call to `load` function to
Evaluate library.

Fix for #18306

* Migrate metric to Evaluate library in tf examples

Currently tensorflow examples use `load_metric` function from Datasets
library , commit migrates function call to `load` function to
Evaluate library.

Fix for #18306

* Migrate `metric` to Evaluate for all tf examples

Currently tensorflow examples use `load_metric` function from Datasets
library , commit migrates function call to `load` function to
Evaluate library.
This commit is contained in:
Vijay S Kalmath
2022-07-28 14:24:27 -04:00
committed by GitHub
parent 7b0908769b
commit a2586795e5
10 changed files with 27 additions and 11 deletions

View File

@@ -27,8 +27,9 @@ from typing import Optional
import datasets
import numpy as np
import tensorflow as tf
from datasets import ClassLabel, load_dataset, load_metric
from datasets import ClassLabel, load_dataset
import evaluate
import transformers
from transformers import (
CONFIG_MAPPING,
@@ -478,7 +479,7 @@ def main():
# endregion
# Metrics
metric = load_metric("seqeval")
metric = evaluate.load("seqeval")
def get_labels(y_pred, y_true):
# Transform predictions and references tensos to numpy arrays