Code Monkey home page Code Monkey logo

maximedotair / article_analysis_gpt Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 10 KB

This Python script allows you to interact with a GPT-3.5-turbo model by OpenAI to analyze and summarize articles from URLs. You can ask questions about the article, and the model will answer based on the content. The script uses the newspaper3k library to extract the article content and the OpenAI API to communicate with the GPT-3.5-turbo model.

License: MIT License

Python 100.00%
article article-summarization gpt gpt-3 gpt-4 gpt-api newspaper openai openai-api python

article_analysis_gpt's Introduction

Article Analysis with GPT-3.5-turbo

This Python script allows you to interact with a GPT-3.5-turbo model by OpenAI to analyze and summarize articles from URLs. You can ask questions about the article, and the model will answer based on the content. The script uses the newspaper3k library to extract the article content and the OpenAI API to communicate with the GPT-3.5-turbo model.

Features

  • Extracts article content from a given URL
  • Splits the article into smaller parts if needed
  • Summarizes the article upon request
  • Allows the user to ask questions about the article
  • Interacts with the GPT-3.5-turbo model via the OpenAI API

Installation

  1. Clone the repository:

Article Analysis with GPT-3.5-turbo

This Python script allows you to interact with a GPT-3.5-turbo model by OpenAI to analyze and summarize articles from URLs. You can ask questions about the article, and the model will answer based on the content. The script uses the newspaper3k library to extract the article content and the OpenAI API to communicate with the GPT-3.5-turbo model.

Features

  • Extracts article content from a given URL
  • Splits the article into smaller parts if needed
  • Summarizes the article upon request
  • Allows the user to ask questions about the article
  • Interacts with the GPT-3.5-turbo model via the OpenAI API

Installation

  1. Clone the repository:

git clone https://github.com/maximedotair/article_analysis_gpt.git

  1. Change to the project directory:

cd article-analysis-gpt

  1. Create a virtual environment and activate it:

python3 -m venv myenv source myenv/bin/activate

  1. Install the required packages:

$ pip install -r requirements.txt

  1. Add your OpenAI API key to the script:

Replace your_api_key_here with your actual API key in the line:

api_key = "your_api_key_here"

Usage

Run the script:

$ python article_analysis.py

Enter the URL of the article to summarize: https://example.com/article-url

Choose to summarize the article or ask your own question:

Do you want to summarize the article? (yes/no): yes

Ask questions about the article:

Ask a question (previous questions and answers are not saved) or type 'exit' to quit: What is the main point of the article?

Type 'exit' to quit the script:

Ask a question (previous questions and answers are not saved) or type 'exit' to quit: exit

Dependencies

OpenAI - Python library for the OpenAI API newspaper3k - Python library for extracting and parsing newspaper articles

License

This project is licensed under the MIT License.

article_analysis_gpt's People

Contributors

maximedotair avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

shubha-mishra

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.