<?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: Ratnesh Kumar</title>
    <description>The latest articles on DEV Community by Ratnesh Kumar (@soniratnesh).</description>
    <link>https://dev.to/soniratnesh</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%2F391382%2Ff038485b-30f1-439d-90dc-eea96414b22e.jpeg</url>
      <title>DEV Community: Ratnesh Kumar</title>
      <link>https://dev.to/soniratnesh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/soniratnesh"/>
    <language>en</language>
    <item>
      <title>Compendium a Abstractive Text Summarization using Attention Mechanism</title>
      <dc:creator>Ratnesh Kumar</dc:creator>
      <pubDate>Mon, 25 May 2020 00:52:59 +0000</pubDate>
      <link>https://dev.to/soniratnesh/compendium-a-abstractive-text-summarization-using-attention-mechanism-4n0</link>
      <guid>https://dev.to/soniratnesh/compendium-a-abstractive-text-summarization-using-attention-mechanism-4n0</guid>
      <description>&lt;h2&gt;
  
  
  My Final Project
&lt;/h2&gt;

&lt;p&gt;“Don’t need the full article or text, just require the summary.” I often think while reading an article or a newspaper. During my under graduation I often face this kind of situation. It's such a drag to read the full report if you can get the compendium. Right?&lt;/p&gt;

&lt;p&gt;During my under-graduation I thought to automate it. Doing it manually takes a lot of time. So, using the magnificent powers of NLP and Deep learning, I came up with the project Compendium. An abstractive text summarization model, that takes a text and provides its summary.&lt;/p&gt;

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

&lt;p&gt;Have an Idea?, want to contribute or want to see code behind the magic. The code can be found in the following GitHub repository.&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/soni-ratnesh"&gt;
        soni-ratnesh
      &lt;/a&gt; / &lt;a href="https://github.com/soni-ratnesh/compendium"&gt;
        compendium
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Generates summary of a given news article. Used attention seq2seq encoder decoder model.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Compendium&lt;/h1&gt;
&lt;h2&gt;
Introduction&lt;/h2&gt;
&lt;p&gt;Compendium is a seq2seq abstractive text symmetrization model based on GRU encoder decoder with attention mechanism.&lt;/p&gt;
&lt;h2&gt;
Base Info&lt;/h2&gt;
&lt;p&gt;Files and there uses are listed below&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Data -&amp;gt; Folder used for train and test data storage
helper -&amp;gt; Contains helper functions used in model.ipynb
brain -&amp;gt; Contains trained RNN Model
Data Clean.ipnb -&amp;gt; Ipython Notbook for cleaning and splitting data into train, val and test
model.ipynb -&amp;gt; Ipython Notebook for training andd testing model.
requirement -&amp;gt; txt file containg required lib
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;
Requirements&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Python : 3.X&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Pip&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
Installation&lt;/h2&gt;
&lt;p&gt;Steps for installation?&lt;br&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Download venv
&lt;code&gt;pip install virtualenv&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Clone
&lt;code&gt;git clone https://github.com/soni-ratnesh/compendium.git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Change directory
&lt;code&gt;cd compendium                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      &lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create virtual environment
&lt;code&gt;pip venv env&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Activate virtual env
&lt;code&gt;. env\bin\activate&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Install required library
&lt;code&gt;pip install -r requirements.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Run Jupyter notebook
&lt;code&gt;jupyter notebook&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Result&lt;/h2&gt;
&lt;p&gt;The testing accuracy and loss are,&lt;br&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Test Loss     :  2.23
Test PPE      :  10.87
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;
Need trained model?&lt;/h2&gt;
&lt;p&gt;We do provide trained model…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/soni-ratnesh/compendium"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I built it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The project was built using Pytorch, Spacy and torchtext. Pytorch is used to build the summarization model, while Spacy and torchtext was used to pre-process data.&lt;/li&gt;
&lt;li&gt;The summarization model is an Encoder decoder model with GRU cell. Why GRU not LSTM? The choice was made after experimentation. Tried both of them but GRU performed slightly better so GRU it is.&lt;/li&gt;
&lt;li&gt;Choosing the data on which to train on was one of the most important decision. As the data is the key factor for this. It's always Garbage In Garbage Out. For better Generalization we used 15000+ News article dataset from &lt;a href="https://www.kaggle.com/sunnysai12345/news-summary"&gt;Kaggle&lt;/a&gt; for training.&lt;/li&gt;
&lt;li&gt;After a few different approaches, finally arrived at Attention Mechanism. Challenging our self to learn and implement it was one of the greatest event.&lt;/li&gt;
&lt;li&gt;GitHub Education Pack helped to get a domain for publishing work. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Additional Thoughts / Feelings / Stories
&lt;/h2&gt;

&lt;p&gt;I am really proud of the model. I further want to improve it and make it better and more general.&lt;br&gt;
At last just want to say every locked door has a key you just have to know where to find it. &lt;/p&gt;

&lt;p&gt;Thank you for reading and Happy Coding!!&lt;/p&gt;

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