Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single Class Span Classification Support #982

Merged
merged 46 commits into from
Feb 14, 2024

Conversation

Steven-Yiran
Copy link
Contributor

Summary

This pull request aims to serve as the starting point to support span classification datasets proposed in #385. Currently, only single-class span classification is supported. One example of a single-class span classification task is Extractive Question Answering.

# Example code snippet
import numpy as np
from cleanlab.experimental.span_classification import find_label_issues

labels = [[0, 0, 1, 1], [1, 1, 0]]
pred_probs = [
    np.array([0.9, 0.9, 0.9, 0.1]),
    np.array([0.1, 0.1, 0.9]),
]

issues = find_label_issues(labels, pred_probs)

Example Usage

An example of using the span_classification module to find label issues in the extractive question-answering dataset SQuAD is provided in a separate repository here.

Steven-Yiran and others added 30 commits September 3, 2023 15:23
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
Co-authored-by: Jonas Mueller <1390638+jwmueller@users.noreply.github.com>
Updated related functions to add class_names optional arg and added related tests.
Added class_accuracy functions and plotting functions; modified doc string
- modified class_name and class_to_show behavior
- added division by zero prevention;
- addressed comments
Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (077f5a9) 96.48% compared to head (7f4f6fd) 96.22%.
Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #982      +/-   ##
==========================================
- Coverage   96.48%   96.22%   -0.26%     
==========================================
  Files          73       74       +1     
  Lines        5714     5803      +89     
  Branches     1020     1037      +17     
==========================================
+ Hits         5513     5584      +71     
- Misses        108      130      +22     
+ Partials       93       89       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Steven-Yiran and others added 4 commits February 11, 2024 20:22
Co-authored-by: Aditya Thyagarajan <aditya1593@icloud.com>
Co-authored-by: Aditya Thyagarajan <aditya1593@icloud.com>
Co-authored-by: Aditya Thyagarajan <aditya1593@icloud.com>
@aditya1503 aditya1503 self-requested a review February 12, 2024 18:33
@aditya1503 aditya1503 self-requested a review February 13, 2024 06:05
@aditya1503 aditya1503 self-requested a review February 13, 2024 09:17
Copy link
Contributor

@aditya1503 aditya1503 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contributions @Steven-Yiran

@aditya1503 aditya1503 merged commit 79b16e6 into cleanlab:master Feb 14, 2024
20 of 21 checks passed
@Steven-Yiran
Copy link
Contributor Author

Thanks @aditya1503 @jwmueller for all the helpful guidance and modifications!

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.

None yet

4 participants