Skip to content

Text classification of news articles for different categories - business, tech, politics, sports and entertainment.

License

Notifications You must be signed in to change notification settings

Riddhi9570/News-article-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

News-article-classification

News Article Classification Model is a machine learning model that classifies news articles into various categories - business, tech, politics, sports and entertainment using Natural Language Processing (NLP).

Models

The models used are:-

  • Logistic Regression
  • Random Forest
  • Multinomial Naive Bayes
  • Support Vector Classifier
  • Decision Tree Classifier
  • K Nearest Neighbour
  • Gaussian Naive Bayes.

Python Libraries

Download these libraries using pip if haven't already:-

  • Natural Language Toolkit
  • Regular Expressions
  • Numpy
  • Pandas
  • Matplotlib
  • Wordcloud
  • Scikit-Learn

Dataset

  • The dataset News.csv comprises of 1490 news articles.
  • It contains three columns - ArticleId, Text and Category(business/tech/politics/sports/entertainment).
  • 30% of dataset is split for test set and the remaining is used for training.

Data Visualization in Numeric form:-

image

Data Visualization in Percentage form:-

image

Visualizing Category Related Words:-

Business Related Words:-

image

Tech Related Words:-

image

Politics Related Words:-

image

Sports Related Words:-

image

Entertainment Related Words:-

image

Data Pre-processing

  • Removal of tags.
  • Removal of special characters.
  • Conversion to lower case.
  • Removal of stop-words.
  • Lemmatizing the Words

Accuracy

  • Accuracy, Precision, Recall and F1 score is displayed for each model.

image

  • The best accuracy of model is 97.99 from Random Forest.

About

Text classification of news articles for different categories - business, tech, politics, sports and entertainment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published