The News Recommendation App is a web application built with Python and Streamlit that provides personalized news recommendations. It utilizes the News API
to fetch current news articles and Gemini AI
LLM API to generate recommendations based on the articles. This application offers a clean and interactive interface for users to discover top-rated news articles across various categories.
See Live demo - https://gitkakkar1597-news-recommender.streamlit.app/
- Dynamic News Fetching: Retrieves the latest news articles based on user-selected categories.
- AI-Powered Recommendations: Uses Gemini AI to generate recommendations based on article data.
- User Interface: Displays news articles in a visually appealing format with ratings and source information.
- Loading Spinner: Shows a spinner while news articles are being fetched to enhance user experience.
- Python: Programming language used for backend logic.
- Streamlit: Framework for building the web application interface.
- News API: Provides news articles from various sources.
- Gemini AI: Used for generating recommendations based on news data.
- Pandas: Data manipulation and analysis library.
news-recommendation-app/
│
├── .env # Environment variables file
├── .gitignore # Git ignore file
├── README.md # Project overview and setup instructions
├── requirements.txt # Project dependencies
├── app.py # Main Streamlit application script
│
├── config/
│ ├── config.py # Script to load environment variables
│
└── utils/
└── fetch_news.py # Script to fetch news articles from the News API
│
└── assets/
└── Screenshot.png # Screenshot or other static assets
To set up the project locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/Gitkakkar1597/News-Application.git cd news-recommender
-
Create and Activate a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Environment Variables: Create a
.env
file in the root directory and add your API keys:NEWS_API_KEY=your_news_api_key GEMINI_API_KEY=your_gemini_api_key
-
Run the Application:
streamlit run app.py
- Open your web browser and navigate to
http://localhost:8501
to access the application. - Enter a category in the text input field or type 'all' to get recommendations from all categories.
- Click the "Get Recommendations" button to fetch and display the top recommended news articles.
- Use the loading spinner for a smooth user experience while news articles are being fetched.
Contributions to the project are welcome! If you would like to contribute, please follow these steps:
- Fork the Repository: Click on the "Fork" button at the top right of this repository.
- Clone Your Fork:
git clone https://github.com/Gitkakkar1597/News-Application.git
- Create a New Branch:
git checkout -b feature/your-feature
- Make Changes: Implement your changes or new features.
- Commit and Push:
git add . git commit -m "Add a descriptive commit message" git push origin feature/your-feature
- Create a Pull Request: Go to the original repository and create a pull request with a clear description of your changes.