Skip to content

Fix/error in accuracy tests for ner task#1116

Merged
chakravarthik27 merged 2 commits intorelease/2.4.0from
fix/error-in-accuracy-tests-for-ner-task
Sep 17, 2024
Merged

Fix/error in accuracy tests for ner task#1116
chakravarthik27 merged 2 commits intorelease/2.4.0from
fix/error-in-accuracy-tests-for-ner-task

Conversation

@chakravarthik27
Copy link
Copy Markdown
Collaborator

update the calculate_f1_score function in /langtest\utils\util_metrics.py

    if isinstance(y_true, list) and isinstance(y_pred, list):
        unique_labels = set(y_true + y_pred)
    elif isinstance(y_true, pd.Series) and isinstance(y_pred, pd.Series):
        unique_labels = set(y_true.tolist() + y_pred.tolist())
    else:
        raise ValueError(
            "y_true and y_pred must be of the same type. Supported types are list and pandas Series."
        )

@chakravarthik27 chakravarthik27 self-assigned this Sep 17, 2024
@chakravarthik27 chakravarthik27 linked an issue Sep 17, 2024 that may be closed by this pull request
@chakravarthik27 chakravarthik27 merged commit b0a1a26 into release/2.4.0 Sep 17, 2024
@chakravarthik27 chakravarthik27 deleted the fix/error-in-accuracy-tests-for-ner-task branch September 23, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Error in Accuracy Tests for NER Task

1 participant