Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Add from_lists to TextClassificationData #805

Merged
merged 7 commits into from
Sep 29, 2021
Merged

Add from_lists to TextClassificationData #805

merged 7 commits into from
Sep 29, 2021

Conversation

kingyiusuen
Copy link
Contributor

@kingyiusuen kingyiusuen commented Sep 27, 2021

What does this PR do?

Fixes #769 (issue)

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link

codecov bot commented Sep 27, 2021

Codecov Report

Merging #805 (4dd3e91) into master (0a28672) will increase coverage by 0.08%.
The diff coverage is 97.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #805      +/-   ##
==========================================
+ Coverage   88.97%   89.05%   +0.08%     
==========================================
  Files         219      219              
  Lines       11879    11916      +37     
==========================================
+ Hits        10569    10612      +43     
+ Misses       1310     1304       -6     
Flag Coverage Δ
unittests 89.05% <97.29%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flash/text/classification/data.py 93.02% <97.05%> (+3.73%) ⬆️
flash/core/data/data_source.py 94.78% <100.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a28672...4dd3e91. Read the comment docs.

hf_dataset = Dataset.from_dict({"input": input, "labels": target})

if not self.predicting:
dataset.multi_label = False
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind adding support for multi label ?

flash/text/classification/data.py Outdated Show resolved Hide resolved
flash/text/classification/data.py Outdated Show resolved Hide resolved
@kingyiusuen kingyiusuen changed the title Add from_list to TextClassificationData Add from_lists to TextClassificationData Sep 27, 2021
@kingyiusuen kingyiusuen requested a review from tchaton September 27, 2021 23:02
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGTM ! Great work !

@mergify mergify bot removed the has conflicts label Sep 29, 2021
@SeanNaren SeanNaren merged commit f495d9d into Lightning-Universe:master Sep 29, 2021
@SeanNaren
Copy link
Contributor

Thank you @kingyiusuen!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for a list of strings and list of targets to text classification
3 participants