Tia  Gottlieb

Tia Gottlieb

1594652700

Building and deploying end-to-end fake news classifier

In this digital era of smartphones and the internet, the fake news spreads like wildfire, it looks just like the real news and causes much damage to the community. So in this tutorial we are going to build a Fake News Classifier and deploy it on the cloud as a web app so that it can be accessed by anyone. It will not be as good as google’s or facebook’s fake news classifier but in accordance to the dataset obtained from Kaggle, it will be pretty decent.

_Before we get started, to get you motivated let me show you the web app you will be able to build by the end of this tutorial Fake News Classifier**. _**Now that you’ve seen the end product, lets get started.

Note: I am assuming that you are familiar with basic machine learning techniques, algorithms, and packages.

I’ve divided this tutorial into three parts:

  1. Exploratory Data Analysis
  2. Preprocessing and Model Training
  3. Building and Deploying Web App on Heroku

Now, if you are a beginner I’d recommend you install Anaconda distribution as it comes with all the necessary package for data science and set up a virtual environment.

If you want to follow along with this tutorial, here is the link to source code on my GitHub: https://github.com/eaofficial/fake-news-classifier.

You can obtain the dataset here or you can clone my GitHub repository.


1. Exploratory Data Analysis

Image for post

Create a file named eda.ipynb or eda.py in your project directory.

We will first import all the required packages.

#Importing all the libraries
import warnings
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import nltk
import re
from wordcloud import WordCloud
import os

Now we will first read fake news dataset using pd.read_csv() and then we will explore the dataset.

In cell 4 of the above notebook, we count the number of sample fake news in each of the subject. We will also plot its distribution using seaborn count plot sns.coountplot() .

We will now plot a word cloud by first concatenating all the news in a single string then generating tokens and removing stopwords. Word cloud is a very good way to visualize the text data.

As you can see in the next cell now we will import true.csv as real news dataset and perform the same steps as we did on the fake.csv. One different thing you’ll notice in the real news dataset is that in the **_text _**column, there is a publication name like _WASHINGTON (Reuters) _separated by a hyphen(-).

It seems that the real news is credible as it comes from a publication house, so we will separate the publication from the news part to make the dataset uniform in the preprocessing part of this tutorial. For now, we’ll just explore the dataset.

If you are following along, you can see that the news subject column has non-uniform distribution in real and fake news dataset so, we will drop this column later. So that concludes our EDA.

Now we can get our hands dirty with something you guys have been waiting for. I know this part is frustrating but EDA and preprocessing is on of the most import in any Data Science lifecycle

#data-science #machine-learning #lstm #data analysis

What is GEEK

Buddha Community

Building and deploying end-to-end fake news classifier

Fake News Detection Project in Python [With Coding]

Ever read a piece of news which just seems bogus? We all encounter such news articles, and instinctively recognise that something doesn’t feel right. Because of so many posts out there, it is nearly impossible to separate the right from the wrong. Here, we are not only talking about spurious claims and the factual points, but rather, the things which look wrong intricately in the language itself.

Did you ever wonder how to develop a fake news detection project? But there is no easy way out to find which news is fake and which is not, especially these days, with the speed of spread of news on social media. Still, some solutions could help out in identifying these wrongdoings.

There are two ways of claiming that some news is fake or not: First, an attack on the factual points. Second, the language. The former can only be done through substantial searches into the internet with automated query systems. It could be an overwhelming task, especially for someone who is just getting started with data science and natural language processing.

The latter is possible through a natural language processing pipeline followed by a machine learning pipeline. It is how we would implement our fake news detection project in Python. It is another one of the problems that are recognized as a machine learning problem posed as a natural language processing problem.

There are many datasets out there for this type of application, but we would be using the one mentioned here. The data contains about 7500+ news feeds with two target labels: fake or real. The dataset also consists of the title of the specific news piece.

The steps in the pipeline for natural language processing would be as follows:

  1. Acquiring and loading the data
  2. Cleaning the dataset
  3. Removing extra symbols
  4. Removing punctuations
  5. Removing the stopwords
  6. Stemming
  7. Tokenization
  8. Feature extractions
  9. TF-IDF vectorizer
  10. Counter vectorizer with TF-IDF transformer
  11. Machine learning model training and verification

#data science #fake news #fake news detection #fake news detection project #python project #python project ideas

Apps For Short News – The Trend Is About To Arrive

Short news apps are the future, and if they will play a defining role in changing the way consumers consume their content and how the news presenters write their report.

If you want to build an app for short news then you can check out some professional app development companies for your app project As we head into the times where mobile applications and smartphones will be used for anything and everything, the short news applications will allow the reader to choose from various options and read what they want to read.

#factors impacting the short news apps #short news applications #personalized news apps #short news mobile apps #short news apps trends #short news apps

The Best Way to Build a Chatbot in 2021

A useful tool several businesses implement for answering questions that potential customers may have is a chatbot. Many programming languages give web designers several ways on how to make a chatbot for their websites. They are capable of answering basic questions for visitors and offer innovation for businesses.

With the help of programming languages, it is possible to create a chatbot from the ground up to satisfy someone’s needs.

Plan Out the Chatbot’s Purpose

Before building a chatbot, it is ideal for web designers to determine how it will function on a website. Several chatbot duties center around fulfilling customers’ needs and questions or compiling and optimizing data via transactions.

Some benefits of implementing chatbots include:

  • Generating leads for marketing products and services
  • Improve work capacity when employees cannot answer questions or during non-business hours
  • Reducing errors while providing accurate information to customers or visitors
  • Meeting customer demands through instant communication
  • Alerting customers about their online transactions

Some programmers may choose to design a chatbox to function through predefined answers based on the questions customers may input or function by adapting and learning via human input.

#chatbots #latest news #the best way to build a chatbot in 2021 #build #build a chatbot #best way to build a chatbot

Aarna Davis

Aarna Davis

1625055931

Hire Front-end Developer | Dedicated Front-end Programmers In India

Hire top Indian front end developers for mobile-first, pixel perfect, SEO friendly and highly optimized front end development. We are a 16+ years experienced company offering frontend development services including HTML / CSS development, theme development & headless front end development utilising JS technologies such as Angular, React & Vue.

All our front-end developers are the in-house staff. We don’t let our work to freelancers or outsource to sub-contractors. Also, we have a stringent hiring mechanism to hire the top Indian frontend coders.

For more info visit: https://www.valuecoders.com/hire-developers/hire-front-end-developers

#front end developer #hire frontend developer #front end development company #front end app development #hire front-end programmers #front end application development

Arno  Bradtke

Arno Bradtke

1602846000

Fake News Detection Using Machine Learning

n this modern world, data is very important and by the 2020 year, 1.7 megaBytes data generated per second. So there are many technologies that change the world by this large amount of data. Machine learning is one of them and we are using this technology to detect fake news.

Machine Learning

Machine learning is an application of AI which provides the ability to system to learn things without being explicitly programmed. Machine learning works on data and it will learn through some data. Machine learning is very different from the traditional approach. In, Machine learning we fed the data, and the machine generates the algorithm. Machine learning has three types of learning

  1. Supervised learning
  2. Unsupervised learning
  3. Reinforcement learning

Supervised learning means we trained our model with labeled examples so the machine first learns from those examples and then performs the task on unseen data. In this fake news detection project, we are using Supervised learning.

Check out more here

What is Fake news?

Fake news simple meaning is to incorporate information that leads people to the wrong path. Nowadays fake news spreading like water and people share this information without verifying it. This is often done to further or impose certain ideas and is often achieved with political agendas.

For media outlets, the ability to attract viewers to their websites is necessary to generate online advertising revenue. So it is necessary to detect fake news.

#fake-news #machine-learning #naive-bayes #naturallanguageprocessing #fake-news-detection