Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#96 Added Fake news detection with TF-IDF and ML #186

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

swati-singh23
Copy link
Contributor

⚡️ Fake News Detection

Description:

This Pull Request implements a basic framework for fake news detection using TF-IDF and a Passive Aggressive Classifier. It includes the following functionalities:➡️

1.Data Loading and Preprocessing:

Reads news articles and labels (fake/real) from a CSV file (news.csv).

2.NLP (TF-IDF):

Applies TF-IDF (Term Frequency-Inverse Document Frequency) to convert textual content into numerical features for machine learning.

3.Machine Learning Model:

Trains a Passive Aggressive Classifier to learn patterns that distinguish fake from real news based on TF-IDF features.

4.Prediction:

Provides a function fake_news_det(news) to predict labels (fake or real) for new, unseen news content.

5.Code Readability:

Enhances code readability by adding comments that explain the NLP and ML stages involved.

Improvements and Benefits:

✨This implementation offers a starting point for exploring fake news detection with machine learning.
✨The inclusion of TF-IDF as a feature extraction technique allows the model to focus on words that are important for a particular news article but not overly common in the entire dataset.
✨Clear comments improve understanding and maintainability of the code.

Copy link

github-actions bot commented Jun 4, 2024

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@sanjay-kv sanjay-kv merged commit d432c19 into recodehive:main Jun 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants