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

Add support for markdown file input #93

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

Conversation

tkhongsap
Copy link

Hi there,
I hope this works this time.

  1. Added markdown_extractor.py for extracting content from Markdown files.
  2. Modified content_extractor.py Markdown parsing features.
  3. Added and updated unit tests (test_markdown_extractor.py, test_content_parser.py) and mock data for Markdown files.
  4. Kept API calls to Gemini and OpenAI as they are, with the language still set to English.
  5. Updated README.md

I ran I ran " poetry run pytest" and had no errors;

@souzatharsis
Copy link
Owner

souzatharsis commented Oct 21, 2024 via email

@tkhongsap
Copy link
Author

Removed audio transcript files from tests.

@souzatharsis
Copy link
Owner

souzatharsis commented Oct 21, 2024 via email

Copy link
Owner

@souzatharsis souzatharsis left a comment

Choose a reason for hiding this comment

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

Tests on github don't pass because you forgot to add some mock data. At least the following:

tests/data/mock/website.md and
tests/data/mock/file.txt

@tkhongsap
Copy link
Author

@souzatharsis Apologies for the delay, I was out of town. I’ve updated the tests as requested and added the necessary mock data files. All tests passed successfully on my side with pytest.

Here’s a summary of the test results:

tests\test_audio.py .ss [ 9%] tests\test_client.py ......s.s.. [ 42%] tests\test_content_parser.py ....s [ 57%] tests\test_genai_podcast.py .... [ 69%] tests\test_generate_podcast.py ....... [ 90%] tests\test_markdown_extractor.py ... [100%]

@souzatharsis
Copy link
Owner

Hi Pytest tests failed.

ModuleNotFoundError: No module named 'markdown'

Could you please review?

@tkhongsap
Copy link
Author

tkhongsap commented Oct 29, 2024

@souzatharsis Hi there,
below are my updates:

  • Updated requirements.txt to include Markdown==3.7 for Python versions between 3.11 and 4.0.
  • Verified all tests passed locally with poetry run pytest.

@souzatharsis
Copy link
Owner

Hi, I recommend instead integration with docling instead of building our own content parsers from scratch:

https://github.com/DS4SD/docling

Improved support, maintainability as well as coverage of courses since docling supports (PDF, DOCX, PPTX, Images, HTML, AsciiDoc, Markdown)

There is an open issue for that if you are excited about it #138

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