Giter Site home page Giter Site logo

op27 / newsautoanalysisgaza Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 27 KB

NewsAutoAnalysisGaza scrapes, analyzes, and summarizes news articles on the Gaza conflict using Python and OpenAI GPT. It provides visualizations like word clouds, frequency charts, and comprehensive summaries for deeper insights into media coverage of the conflict.

License: MIT License

Python 100.00%
chatgpt news-aggregator news-summarizer openai openai-api scraping gaza python

newsautoanalysisgaza's Introduction

NewsAutoAnalysisGaza

NewsAutoAnalysisGaza is a tool designed to scrape, analyze, and summarize news articles focusing on the Gaza conflict. By leveraging advanced Python libraries and OpenAI's GPT models, this application provides insightful visualizations such as word clouds and frequency analysis charts, alongside comprehensive summaries that offer a deeper understanding of the conflict's coverage in the media.

Demo.video.mp4

Features

  • Article Scraping: Automatically scrapes news articles from specified sources.
  • Data Analysis: Performs text analysis to identify the most frequent terms and generates word clouds and bar charts.
  • Summarization: Utilizes OpenAI's GPT models to generate concise summaries of the collected articles.
  • Customization: Offers users the ability to customize the analysis and summarization processes via editable configuration files (prompt.txt), enhancing the relevance and precision of the outputs for varied use cases.
  • Automation: Streamlines the entire process from data collection to analysis and summarization, requiring minimal user input.

Getting Started

Prerequisites

Ensure you have Python 3.x installed on your system. This project depends on several Python libraries, including requests, beautifulsoup4, wordcloud, matplotlib, python-docx, and openai. You can install these using pip:

pip install requests beautifulsoup4 wordcloud matplotlib python-docx openai

Installation

  1. Clone the repository to your local machine:

    git clone https://github.com/Op27/NewsAutoAnalysisGaza.git
  2. Navigate to the project directory:

    cd NewsAutoAnalysisGaza
  3. Install the required Python packages:

    pip install -r requirements.txt

    Note: This command ensures that all the necessary Python packages are installed and up to date. If you have previously installed the required packages, this command will verify your installation, making it a safe operation to perform.

Usage

To run the tool, execute the main script from the command line:

python main.py

Obtaining OpenAI API Key

For summarization features in NewsAutoAnalysisGaza, an API key from OpenAI is required. This key enables interaction with OpenAI's GPT models to generate summaries. To obtain an API key, users must create an account on the OpenAI platform and follow the instructions to register for API access. Please be aware that OpenAI's services might incur costs depending on the usage volume, so it's advisable to review their pricing structure. After obtaining your API key, ensure to secure it properly and not to share it publicly or with unauthorized users.

Customization

Configuring the prompt.txt for OpenAI

NewsAutoAnalysisGaza utilizes OpenAI's GPT models for generating summaries of the scraped news articles. The tool sends a customizable prompt to the GPT model, which is defined in the prompt.txt file. Users can modify this file to tailor the analysis and summaries generated by the tool according to their specific requirements or interests.

Editing prompt.txt

  1. Locate the prompt.txt file in the root directory of the project.
  2. Open the file in a text editor of your choice.
  3. Edit the prompt according to your needs. The content of this file will be used as the basis for the GPT model's text generation, so consider what instructions or context you want to provide to achieve the desired output.
  4. Save your changes to the file before running the analysis.

This flexibility allows users to direct the focus of the summaries, making the tool versatile across a range of use cases. Whether you're interested in highlighting certain aspects of the news articles or analyzing from a specific perspective, customizing the prompt.txt file enables personalized analysis outputs.

How It Works

Scraping: The tool first scrapes news articles from pre-defined URLs.
Analysis: Analyzes the text to generate visualizations and identify key themes.
Summarization: Summarizes the content using GPT, producing a coherent overview of the main points.

Disclaimer

Web Scraping

Web scraping, as utilized by NewsAutoAnalysisGaza for analyzing publicly available news articles, is legal within certain boundaries. However, it's critical to note that personal data is protected under GDPR in the European Union and by similar privacy laws worldwide. Users of NewsAutoAnalysisGaza should ensure not to scrape personal data unless they have a legitimate reason, in accordance with applicable privacy laws. We encourage users to familiarize themselves with and adhere to the terms of service of any source websites, including but not limited to BBC, when using this tool.

Responsibility

The use of NewsAutoAnalysisGaza and any actions or consequences resulting from its application are solely the responsibility of the user. The project owners and contributors do not assume any legal liability or responsibility for the manner in which the tool is used or for ensuring compliance with applicable laws. Users are responsible for using NewsAutoAnalysisGaza in a manner that is consistent with all relevant legal requirements and regulations that apply to their specific circumstances.

Contributing

Contributions to NewsAutoAnalysisGaza are welcome! If you have suggestions for improvements or new features, please feel free to:

  • Open an issue to discuss what you would like to change.
  • Fork the repository and submit a pull request with your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

newsautoanalysisgaza's People

Contributors

op27 avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.