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

Fix test_basic_article_trafilatura test failure #264

Merged
merged 5 commits into from
Aug 14, 2024

Conversation

tylerjthomas9
Copy link
Contributor

@tylerjthomas9 tylerjthomas9 commented Aug 8, 2024

"Hello World!" is being duplicated in the trafilatura extraction test on trafilatura==1.12.0 (released last week).

=========================== short test summary info ============================
FAILED tests/pipeline/test_extractors.py::TestExtractors::test_basic_article_trafilatura - AssertionError: 'Hello World!\nHello World!' != 'Hello World!'
- Hello World!
  Hello World!
======= 1 failed, 63 passed, 1 skipped, 19 warnings in 90.94s (0:01:30) ========

This issue appears relevant. trafilatura is duplicating the text because it is too short.

To fix this issue, I modified the config for trafilatura to set MIN_EXTRACTED_SIZE=0.

I also verified that the issue only appears in v1.12.0 tylerjthomas9#1.

@hynky1999
Copy link
Contributor

Great catch!

I think best way to handle this is to lock the trafilatura to < 1.12.0.
They must have changed the way they process short htmls which is the reason why the duplication happens.
This fix would rather hide it then solve it

@hynky1999 hynky1999 merged commit 83dbddf into huggingface:main Aug 14, 2024
4 checks passed
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.

2 participants