<?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>DEV Community: Danyaal</title>
    <description>The latest articles on DEV Community by Danyaal (@dantm99).</description>
    <link>https://dev.to/dantm99</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%2F390481%2Fcf3ded5f-b530-4b8b-8f1c-1eef5fde003e.png</url>
      <title>DEV Community: Danyaal</title>
      <link>https://dev.to/dantm99</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dantm99"/>
    <language>en</language>
    <item>
      <title>GPT2 Article Generator</title>
      <dc:creator>Danyaal</dc:creator>
      <pubDate>Wed, 20 May 2020 10:31:47 +0000</pubDate>
      <link>https://dev.to/dantm99/placeholder-title-15oi</link>
      <guid>https://dev.to/dantm99/placeholder-title-15oi</guid>
      <description>&lt;h2&gt;
  
  
  My Final Project
&lt;/h2&gt;

&lt;p&gt;I built an application to allow for generating news articles using OpenAI's GPT-2 text generator. The headline is provided by the user and they can optionally provide the start of the article, then it generates the rest of the article. The program has both a command line interface and a GUI, making it easy to use but also making it easier to integrate into other tools.&lt;/p&gt;

&lt;h2&gt;
  
  
  Link to Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/DanTm99/gpt2-article-generator"&gt;https://github.com/DanTm99/gpt2-article-generator&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vWogaON8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-28d89282e0daa1e2496205e2f218a44c755b0dd6536bbadf5ed5a44a7ca54716.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/DanTm99"&gt;
        DanTm99
      &lt;/a&gt; / &lt;a href="https://github.com/DanTm99/gpt2-article-generator"&gt;
        gpt2-article-generator
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      An application that uses GPT-2 to generate news articles from user given prompts
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
GPT2 Article Generator&lt;/h1&gt;
&lt;p&gt;An application to allow for generating news articles using &lt;a href="https://openai.com" rel="nofollow"&gt;OpenAI&lt;/a&gt;'s &lt;a href="https://openai.com/blog/better-language-models/" rel="nofollow"&gt;GPT-2 text generator&lt;/a&gt;. The model used for this was further trained on &lt;a href="https://www.kaggle.com/snapcrack/all-the-news" rel="nofollow"&gt;All The News&lt;/a&gt;, a dataset of over 200,000 news articles by &lt;a href="https://components.one/" rel="nofollow"&gt;components.one&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
Setup&lt;/h2&gt;
&lt;p&gt;The repository can be cloned as normal:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell"&gt;&lt;pre&gt;git clone https://github.com/DanTm99/gpt2-article-generator.git&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The model this program uses is hosted on Google Drive and can be downloaded from &lt;a href="https://drive.google.com/open?id=1Lmh7JBRkbC0jEvGtoZwVL30PT8PIt9qm" rel="nofollow"&gt;here&lt;/a&gt;. The contents of this archive should be extracted to the &lt;code&gt;gpt2-article-generator&lt;/code&gt; folder so that the &lt;code&gt;checkpoint&lt;/code&gt; is in the &lt;code&gt;gpt2-article-generator&lt;/code&gt; folder.&lt;/p&gt;
&lt;p&gt;Navigate into the folder:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell"&gt;&lt;pre&gt;&lt;span class="pl-c1"&gt;cd&lt;/span&gt; gpt2-article-generator&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To use this with your GPU you must have and NVIDIA GPU with a CUDA Compute Capability 3.5 or higher.&lt;/p&gt;
&lt;p&gt;If you have the required hardware you must install the required software on your system as shown &lt;a href="https://www.tensorflow.org/install/gpu#software_requirements" rel="nofollow"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Install the required packages as normal to use this with GPU support:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell"&gt;
&lt;pre&gt;pip3 install -r&lt;/pre&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/DanTm99/gpt2-article-generator"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I built it (what's the stack? did I run into issues or discover something new along the way?)
&lt;/h2&gt;

&lt;p&gt;I coded the project in Python and used TensorFlow as the models that were the focus on this project were TensorFlow models. In making this I learned how to interact with GPT-2, including further training it and using it to generate text in various ways.&lt;/p&gt;

</description>
      <category>octograd2020</category>
    </item>
  </channel>
</rss>
