Giter Site home page Giter Site logo

chat-with-website's Introduction

NewsInsight: Intelligent News Analysis Tool ๐Ÿ“ˆ

NewsInsight is a Streamlit application designed to help users extract and analyze information from news articles. By providing URLs of news articles, the tool processes the content, creates embeddings, and allows users to query the information using OpenAI's language model.

Features

  • Extracts content from provided news article URLs.
  • Splits the content into manageable chunks for processing.
  • Creates embeddings using OpenAI embeddings.
  • Stores the embeddings in a FAISS index.
  • Allows users to query the stored information and retrieve answers along with their sources.

Installation

To run this application, follow these steps:

Prerequisites

  • Python 3.10 (recommended)
  • Git
  • OpenAI API key

Clone the Repository

git clone https://github.com/yourusername/NewsInsight.git
cd NewsInsight

Create and Activate a Virtual Environment (optional but recommended)

python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`

Install Dependencies

pip install -r requirements.txt

Set Up Environment Variables

Create a .env file in the project directory and add your OpenAI API key:

OPENAI_API_KEY=your_openai_api_key

Usage

Running the Application

To start the Streamlit application, run:

streamlit run app.py

Using the Application

  1. Enter URLs: Use the sidebar to input up to three news article URLs.
  2. Process URLs: Click the "Process URLs" button to load, split, and create embeddings for the articles.
  3. Ask Questions: Once the processing is complete, you can enter your question in the main input field to retrieve answers and their sources.

Example Workflow

  1. Enter the URLs of the news articles you want to analyze.
  2. Click the "Process URLs" button.
  3. After processing, enter your question in the input field.
  4. The application will display the answer and list the sources of information.

Files and Structure

  • app.py: Main application script.
  • requirements.txt: List of dependencies.
  • .env: Environment variables (not included in the repository).
  • faiss_store_openai.pkl: Pickle file where the FAISS index is stored (generated after processing URLs).

chat-with-website's People

Contributors

patelharsh21 avatar

Watchers

 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.