In today's world, many news articles carry some degree of bias—whether intentional or not. This project tackles the challenge of biased reporting by aggregating news articles from diverse publishers and generating an unbiased article. The goal is to create comprehensive articles that fairly represent all viewpoints on a given topic.
Ask Gemini AI to clarify details or gain deeper insights into any part of a news article. This feature helps dispel misconceptions and ensures readers are well-informed.
Analyse how an article aligns with political spectrums (e.g., Democrat or Conservative in the US), assess its level of bias, and determine its tone (positive or negative).
Input the URL of any news article to transform it into different versions tailored to your preferences:
-
Unbiased Version: A rewritten version that eliminates political bias and presents a balanced perspective, incorporating viewpoints from diverse sources. This version aims to provide a fair and factual representation of the topic.
-
Opposite Political Leaning: An article rewritten such that it reflects the opposing political spectrum (e.g., liberal to conservative or vice versa). This feature is designed to help users identify potential bias by contrasting viewpoints and seeing how facts might be presented differently to align with specific political agendas.
-
Opposite Tone: An article rewritten with the opposite emotional tone (e.g., negative to positive or positive to negative). This allows users to experience news with a different emotional lens, addressing concerns about the predominance of negative reporting in the media.
-
Simplified Version: A concise and easy-to-understand summary of the article, ideal for accessibility or for readers looking for a quick overview without delving into complex details.
- Expand the range of news sources to include international publishers.
- Introduce article categories such as Politics, Business, Technology, etc.
Enable users to input a news article link to generate an unbiased version of it.(implemented!)
Check out the live demo: Unbiased News Demo
-
Clone this repository and navigate to the project directory.
-
Install the required dependencies:
pip install Flask google-generativeai python-dotenv newspaper4k lxml-html-clean
-
Create a
.env
file and add your Gemini API key:GEMINI_API_KEY="your-key-here"
-
Start the application:
flask run
-
Install additional dependencies:
pip install scikit-learn networkx typing-extensions
-
Add the News API key to your
.env
file:NEWS_API_KEY="your-key-here"
-
Run
update_server.py
, followed byupdate_server_2.py
.
- Frontend: HTML, CSS, JavaScript
- Backend: Python with Flask
- Database: SQL
- Stack Overflow
- ChatGPT
- GitHub Copilot
(Note: Don't worry, I built most of the project myself! These tools helped primarily with generating prompts for Gemini AI and some support in HTML, CSS, and JavaScript as I'm not too well-versed in those technologies.)
I started this project before discovering Hack Club and had written a bunch of code that was not tracked by Hackatime because I had not installed the extension. However, I accidentally shipped it as a new project without realising there was an option to ship it as an update. Please refer to this thread for more details.