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

QuestionAnsweringTask and QuestionAnsweringData with SQuADDatSource. #607

Conversation

karthikrangasai
Copy link
Contributor

@karthikrangasai karthikrangasai commented Jul 20, 2021

What does this PR do?

Fixes #577
Fixes #540
Fixes #541

  • Update / rewrite QuestionAnsweringTask and QuestionAnsweringData to handle HF AutoModelForQuestionAnswering as backbone.
  • Provide SQuAD Dataset as a SQuADDataSource.
  • Add examples and documentation for both the Task and Data classes.
  • Added tests (needs some work here).

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 Jul 20, 2021

Codecov Report

Merging #607 (28f282e) into master (c512c31) will decrease coverage by 0.65%.
The diff coverage is 76.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #607      +/-   ##
==========================================
- Coverage   90.01%   89.36%   -0.66%     
==========================================
  Files         195      197       +2     
  Lines        9975    10502     +527     
==========================================
+ Hits         8979     9385     +406     
- Misses        996     1117     +121     
Flag Coverage Δ
unittests 89.36% <76.75%> (-0.66%) ⬇️

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

Impacted Files Coverage Δ
flash/__main__.py 95.23% <ø> (ø)
flash/text/seq2seq/__init__.py 100.00% <ø> (ø)
flash/text/question_answering/finetuning.py 19.78% <19.78%> (ø)
flash/text/question_answering/data.py 86.17% <86.17%> (ø)
flash/text/question_answering/model.py 90.57% <90.57%> (ø)
flash/text/__init__.py 100.00% <100.00%> (ø)
flash/text/question_answering/__init__.py 100.00% <100.00%> (ø)
flash/text/question_answering/cli.py 100.00% <100.00%> (ø)
flash/text/seq2seq/core/model.py 75.32% <0.00%> (-1.30%) ⬇️
... and 6 more

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 c512c31...28f282e. Read the comment docs.

Copy link
Collaborator

@ethanwharris ethanwharris left a comment

Choose a reason for hiding this comment

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

Awesome work @karthikrangasai just a few small comments

flash/text/seq2seq/core/data.py Outdated Show resolved Hide resolved
flash/text/seq2seq/question_answering/data.py Outdated Show resolved Hide resolved
flash/text/seq2seq/question_answering/data.py Outdated Show resolved Hide resolved
@karthikrangasai karthikrangasai changed the title [wip] Added SQuADDatSource class and an example for the QuestionAnsweringTask Added SQuADDatSource class and an example for the QuestionAnsweringTask Aug 20, 2021
@karthikrangasai karthikrangasai marked this pull request as ready for review August 20, 2021 04:55
@mergify mergify bot removed the has conflicts label Aug 23, 2021
@karthikrangasai karthikrangasai changed the title Added SQuADDatSource class and an example for the QuestionAnsweringTask QuestionAnsweringTask and QuestionAnsweringData with SQuADDatSource. Aug 23, 2021
Copy link
Collaborator

@ethanwharris ethanwharris left a comment

Choose a reason for hiding this comment

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

Really awesome work!!!! Just a few small comments, maybe just remove the deserializer / serve stuff for now and we can add it in a follow-up PR with an example?

docs/source/api/text.rst Outdated Show resolved Hide resolved
docs/source/reference/question_answering.rst Outdated Show resolved Hide resolved
flash/text/question_answering/cli.py Outdated Show resolved Hide resolved
flash/text/question_answering/data.py Outdated Show resolved Hide resolved
flash/text/question_answering/data.py Outdated Show resolved Hide resolved
flash/text/question_answering/model.py Outdated Show resolved Hide resolved
flash/text/question_answering/model.py Outdated Show resolved Hide resolved
flash_examples/question_answering.py Show resolved Hide resolved
@karthikrangasai
Copy link
Contributor Author

Sure, I will remove the serve and deserializer code.

@ethanwharris ethanwharris merged commit 5b94abf into Lightning-Universe:master Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants