Code Monkey home page Code Monkey logo

bangla-news-headlines-categorization's Introduction

Bangla News Headlines Categorization Using Gated Recurrent Unit (GRU): Project Overview

  • Created a tool that can categorizes the Bengali news headlines into six category (National, Politics, International, Sports, Amusement, IT) using deep recurrent neural network.
  • A dataset of 0.13 Million news headlines is created. In built chrome web scrapper used for scraping the news headlines from different Bengali online news portals such as Dainik Jugantor, Dainik Ittefaq, Dainik Kaler Kontho and so on.
  • Word embeeding feature represtations technique is used for extracting the semantic meaning of the words.
  • A deep learning model has been built by using a bidirectional gated recurrent network.
  • Finally, the model performance is evaluated using various evaluation measures such as confusion matrix, accuracy , precision, recall and f1-score.

Resources Used

  • Developement Envioronment : Google Colab
  • Python Version : 3.7
  • Framework and Packages : Tensorflow, Scikit-Learn, Pandas, Numpy, Matplotlib, Seaborn
  • Scrapper : Chrome Web Scrapper

Project Outline

  • Data Collection and Cleaning
  • Data Summary
  • Data Preparation for Model Building
  • Model Development
  • Model Evaluation

Data Collection and Cleaning

Data is collected by creating a scraping graph using chrome web scarpper. Around 0.13 Million Bengali news headlines of six categries are scrapped from different online news portals. The news portals are Dainik Jugantor, Dainik Ittefaq, Dainik Kaler Kontho and so on. The headlines distribution of each categories represents in the following figure. This dataset is an imbalanced dataset.

As the headlines are small in length it is not mandatory to remove the stopwords from the headlines. After cleaning the sample data would look like this.

Sample Data

Data Summary

Data summary includes the information about number of documents, words and unique words have in each category class. Also, include the length distribution of the headlines in the dataset.

| national | international | politics | sports |amusement |it |

length distribution

From this graphical information we can select the suitable length of headlines that we have to use for making every headlines into a same length.

Data Preparation for Model Building

The text data are represented by a encoded sequence where the sequences are the vector of index number of the contains words in each headlines. The categories are also encoded into numeric values. After preparing the headlines and labels it looks as - ecoded_sequence labels

For Model Evaluation the encoded headlines are splitted into Train-Test-Validation Set. The distribution has -

split

Model Development

The used model architecture consists of a embedding layer(input_length = 21, embedding_dim = 64), GRU layer(n_units = 64), two dense layer (n_units = 24, 6), a dropout and a softmax layer. The Architecture looks like-

model

Model Evaluation

In this simple model we have got 81% validation accuracy which is not bad for such an multiclass imbalanced dataset. Besides Confusion Matrix and other evaluation measures have been taken to determine the effectiveness of the developed model. From the confusion matrix it is observed that the maximum number of misclassified headlines are fall in the caltegory of Natinal, International and Politics and it makes sense because this categories headlines are kind of similar in words. The accuracy, precision, recall and f1-score result also demonstrate this issue.

confusion

performance

In conclusion, we have achieved a good accuracy of 84% on this simple recurrent neural network for Bengali news headline categorization task. This accuray can be further improved by doing hyperparameter tunning and by employing more shophisticated network architecture with a large dataset.

bangla-news-headlines-categorization's People

Contributors

eftekhar-hossain avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.