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

feat: add blog post and example script for extracting YouTube video chapters using OpenAI models #831

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

jxnl
Copy link
Owner

@jxnl jxnl commented Jul 11, 2024

@ivanleomk can you take a read, this is claude generated, polish it up a little bet and merge whenever


🚀 This description was created by Ellipsis for commit b843258

Summary:

Added a blog post, example script, user interface, and tests for extracting YouTube video chapters using OpenAI models, Instructor, and Pydantic.

Key points:

  • Added docs/blog/posts/youtube-transcripts.md with a detailed guide on extracting structured chapter information from YouTube video transcripts using OpenAI's language models, Instructor, and Pydantic.
  • Introduced examples/youtube/run.py script to demonstrate the implementation of extracting chapters from YouTube transcripts.
  • Defined Chapter model in both docs/blog/posts/youtube-transcripts.md and examples/youtube/run.py for structured chapter information.
  • Implemented get_youtube_transcript function to fetch YouTube video transcripts.
  • Implemented extract_chapters function to extract chapters using OpenAI's language models.
  • Added user interface in examples/youtube/run.py for processing YouTube videos and displaying chapters.
  • Implemented process_youtube_video function to process a YouTube video and print extracted chapters.
  • Added tests/llm/test_openai/docs/test_posts.py to validate code examples in the blog post.

Generated with ❤️ by ellipsis.dev

@jxnl jxnl requested a review from ivanleomk July 11, 2024 22:33
@ellipsis-dev ellipsis-dev bot changed the title ... feat: add blog post and example script for extracting YouTube video chapters using OpenAI models Jul 11, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to cda0a70 in 35 seconds

More details
  • Looked at 403 lines of code in 2 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. docs/blog/posts/youtube-transcripts.md:123
  • Draft comment:
    The complete script included here is redundant since it is already provided in the examples/youtube/run.py. Consider removing this section and referring readers to the example script to avoid duplication and ease maintenance.
  • Reason this comment was not posted:
    Confidence of 30% on close inspection, compared to threshold of 85%.

Workflow ID: wflow_64qqpyyenCgG9Jbq


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

cloudflare-pages bot commented Jul 11, 2024

Deploying instructor with  Cloudflare Pages  Cloudflare Pages

Latest commit: b843258
Status: ✅  Deploy successful!
Preview URL: https://58e9851e.instructor.pages.dev
Branch Preview URL: https://youtube-transcripts.instructor.pages.dev

View logs

def extract_chapters(transcript: str):
"""Extract chapters from the transcript using AI."""
return client.chat.completions.create_iterable(
model="gpt-4", # You can experiment with different models
Copy link
Owner Author

Choose a reason for hiding this comment

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

Suggested change
model="gpt-4", # You can experiment with different models
model="gpt-4o", # You can experiment with different models

def extract_chapters(transcript: str):
"""Extract chapters from the transcript using AI."""
return client.chat.completions.create_iterable(
model="gpt-4", # You can experiment with different models
Copy link
Owner Author

Choose a reason for hiding this comment

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

Suggested change
model="gpt-4", # You can experiment with different models
model="gpt-4o", # You can experiment with different models

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on e1e8e14 in 42 seconds

More details
  • Looked at 368 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_zIFy3JixITypU09U


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

docs/blog/posts/youtube-transcripts.md Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on b843258 in 1 minute and 22 seconds

More details
  • Looked at 182 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_Bxdrnmq64uYOZSDx


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Collaborator

@ivanleomk ivanleomk left a comment

Choose a reason for hiding this comment

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

Fixed up some additional changes to the article and a new run.py script that reproduces the gif

@ivanleomk ivanleomk merged commit 7ae8178 into main Jul 15, 2024
15 of 16 checks passed
@ivanleomk ivanleomk deleted the youtube-transcripts branch July 15, 2024 03:16
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.

None yet

2 participants