Skip to content

Data Loading: The code loads a dataset from a CSV file containing news article

Notifications You must be signed in to change notification settings

jEeVaf/fake-news-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Here's a breakdown of the key components in the code:

Data Loading: The code loads a dataset from a CSV file containing news articles and their corresponding labels (fake or real).

Text Preprocessing: It preprocesses the text data using TF-IDF vectorization, which converts the raw text into numerical features that can be used by machine learning algorithms.

Model Training: The Passive Aggressive Classifier is trained on the TF-IDF transformed training data. This classifier is known for its ability to perform well in online learning scenarios, making it suitable for text classification tasks.

Model Evaluation: The trained model is used to make predictions on the test data, and its accuracy is evaluated using the accuracy score. Additionally, a confusion matrix is generated to visualize the classifier's performance in distinguishing between fake and real news articles.

Overall, this code demonstrates a simple yet effective approach to building a fake news detector using machine learning techniques.

About

Data Loading: The code loads a dataset from a CSV file containing news article

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages