<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Denis Gavrilin</title>
    <description>The latest articles on Forem by Denis Gavrilin (@swol1).</description>
    <link>https://forem.com/swol1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F445949%2F4d294738-6774-4c4b-932a-de5c9ead7936.jpeg</url>
      <title>Forem: Denis Gavrilin</title>
      <link>https://forem.com/swol1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/swol1"/>
    <language>en</language>
    <item>
      <title>GitHub Challenge: AI-Powered Text Summarizer &amp; Questions Generator</title>
      <dc:creator>Denis Gavrilin</dc:creator>
      <pubDate>Sat, 18 Jan 2025 20:15:24 +0000</pubDate>
      <link>https://forem.com/swol1/github-challenge-ai-powered-text-summarizer-questions-generator-eai</link>
      <guid>https://forem.com/swol1/github-challenge-ai-powered-text-summarizer-questions-generator-eai</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/github"&gt;GitHub Copilot Challenge &lt;/a&gt;: New Beginnings&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I developed a text summarization application capable of processing text files (.pdf, .txt) and YouTube video transcripts to generate summaries with self-check questions. My motivation for building this tool was to streamline learning: often, you want to extract the essential information from a book or lecture while eliminating irrelevant details, or convert video content into digestible text. This application provides quick, dry summaries with questions that can help you verify your understanding of the material.&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;You can run the application using the command line. The application accepts either a file path or a YouTube video URL to fetch transcripts from.&lt;/p&gt;

&lt;h3&gt;
  
  
  Options
&lt;/h3&gt;

&lt;p&gt;Required&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--file_path&lt;/code&gt;: Path to the input file (.txt or .pdf)
or&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--youtube_url&lt;/code&gt;: YouTube video URL to fetch transcripts from&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Optional&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--language&lt;/code&gt;: The language for output summarization&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--tokens&lt;/code&gt;: Number of tokens for the summary, how big you want your summary, better use reasonably big amount&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--chunk_size&lt;/code&gt;: Size of chunks your text will be split into, for each chunk there will be a summary&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--num_questions&lt;/code&gt;: Number of questions to generate for each summary&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--summary_path&lt;/code&gt;: Folder path to save the summary file&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Currently, I didn't create a web-based demo due to API token limitations; instead, the application is available as a CLI tool. Users can supply their own OpenAI API tokens to try it out. Here are a couple of examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From the text available &lt;a href="https://github.com/swol1/smrz/blob/main/sample_text.txt" rel="noopener noreferrer"&gt;here&lt;/a&gt;, the tool generated this summary with questions: &lt;a href="https://github.com/swol1/smrz/blob/main/sample_text_summary.md" rel="noopener noreferrer"&gt;sample_text_summary.md&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;For the YouTube video &lt;a href="https://youtu.be/1Y82U450zcI?si=Bha-22ohxnOr9iw0" rel="noopener noreferrer"&gt;1Y82U450zcI&lt;/a&gt;, it produced this summary with questions: &lt;a href="https://github.com/swol1/smrz/blob/main/youtube_summary_1Y82U450zcI.md" rel="noopener noreferrer"&gt;youtube_summary_1Y82U450zcI.md&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Repository
&lt;/h2&gt;

&lt;p&gt;The project's source code is publicly available on GitHub: &lt;a href="https://github.com/swol1/smrz" rel="noopener noreferrer"&gt;smrz repository&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Copilot Experience
&lt;/h2&gt;

&lt;p&gt;Although I'm not deeply experienced with python, I was able to develop this application with GitHub Copilot's assistance. Copilot helped generate code, handle errors and edge cases, and structure functionality. While organizing the code and creating tests were challenging, Copilot proved to be a valuable tool since I don't know python. Without Copilot, building this project in python would likely have taken much longer.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub Models
&lt;/h2&gt;

&lt;p&gt;For prototyping LLM capabilities within my app, I leveraged GitHub Models, specifically the OpenAI GPT-4 model (referred to as gpt-4o) via the OpenAI API. This integration enhanced the summarization and question generation features, enabling more intelligent and responsive outputs. Prior attempts to use local large language models were slower and produced less satisfactory results, so using GitHub's model was a significant improvement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building this application in one day with about 80% assistance from Copilot was fun. There are countless ways to improve the app and enhance code organization, but working within these constraints helped me focus on the core functionality. This project not only achieved its goals but also provided valuable learning experiences in leveraging AI tools for development.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>githubchallenge</category>
      <category>webdev</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
