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

Introduce pdf support (#7318) #7325

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

yabramuvdi
Copy link

@yabramuvdi yabramuvdi commented Dec 12, 2024

First implementation of the Pdf feature to support pdfs (#7318) . Using pdfplumber as the default library to work with pdfs.
@lhoestq and @AndreaFrancis

Copy link
Contributor

@AndreaFrancis AndreaFrancis left a comment

Choose a reason for hiding this comment

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

Great contribution, @yabramuvdi! 🎉
I added a couple of minor comments. It would also be great to add pdfplumber to the dependencies in the setup.py file and perhaps include a few tests for the new features.
Thanks in advance! This will help us unblock some other features in the datasets-viewer project as well.

src/datasets/features/pdf.py Outdated Show resolved Hide resolved
src/datasets/features/pdf.py Outdated Show resolved Hide resolved
src/datasets/features/pdf.py Outdated Show resolved Hide resolved
src/datasets/features/pdf.py Outdated Show resolved Hide resolved
src/datasets/features/pdf.py Outdated Show resolved Hide resolved
src/datasets/features/pdf.py Outdated Show resolved Hide resolved
src/datasets/features/pdf.py Outdated Show resolved Hide resolved
src/datasets/features/pdf.py Outdated Show resolved Hide resolved
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

Awesome ! the implementation looks all good to me :)

could you add a test before we merge ? something as simple as test_video_feature_encode_example and test_dataset_with_video_feature from test_video.py maybe

src/datasets/features/pdf.py Outdated Show resolved Hide resolved
src/datasets/features/pdf.py Outdated Show resolved Hide resolved
src/datasets/features/pdf.py Outdated Show resolved Hide resolved
yabramuvdi and others added 14 commits December 19, 2024 16:57
Co-authored-by: Andrea Francis Soria Jimenez <andrea@huggingface.co>
Co-authored-by: Andrea Francis Soria Jimenez <andrea@huggingface.co>
Co-authored-by: Andrea Francis Soria Jimenez <andrea@huggingface.co>
Co-authored-by: Andrea Francis Soria Jimenez <andrea@huggingface.co>
Co-authored-by: Andrea Francis Soria Jimenez <andrea@huggingface.co>
Co-authored-by: Andrea Francis Soria Jimenez <andrea@huggingface.co>
Co-authored-by: Andrea Francis Soria Jimenez <andrea@huggingface.co>
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
@yabramuvdi
Copy link
Author

Hi @AndreaFrancis and @lhoestq ! Thanks for looking at the code and for all the changes and suggestions. I have worked on all your suggestions. I need to work a bit more on the tests, but I created a first version and uploaded a simple pdf to use for testing. The pdf has a couple of pages some of which have images, figures, and tables (this is exactly the pdfs for which I think keeping the pdf format is very interesting because they have multiple types of content). Will try to finish the tests as soon as possible.

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.

4 participants