Multiverse-of-Projects / NewsAI

A dynamic NewsAI dashboard that uses NLP to analyze news articles, visualize sentiment trends, and extract insights through interactive data visualizations.
https://www.youtube.com/watch?v=stTXgljJVPQ
GNU General Public License v3.0
9 stars 10 forks source link

Implement Chat with RAG and Suggested Questions for Summarized News #48

Open hem210 opened 4 days ago

hem210 commented 4 days ago

Description
We need to implement a chat box on the platform that allows users to query the news summaries and receive answers based on RAG (Retrieval-Augmented Generation). Additionally, we want to display suggested questions derived from the summaries, offering a more guided interaction for the user.

Requirements:

  1. Chat Box with RAG:

    • Implement a chat box on the Streamlit frontend where users can ask questions related to the displayed news summaries.
    • Use a RAG pipeline to:
      • Retrieve relevant information from the combined summaries.
      • Generate answers by leveraging the retrieved context.
    • Display the answers within the chat interface.
  2. Suggested Questions:

    • Automatically generate and display suggested starter questions to guide the user.
    • Suggested questions should be based on the content in the summaries and should offer common or interesting inquiries the user might have.
    • Display these questions above or near the chat input box, allowing users to click on them to populate the chat box.
  3. Backend Implementation:

    • Summarized News Retrieval:
      • Implement a retrieval mechanism that can extract relevant information from the corpus of news summaries.
    • Generation of Responses:
      • Use an (open source) LLM to answer user queries based on the retrieved context.
    • Suggested Questions Generation:
      • Leverage NLP techniques to automatically generate a set of suggested questions from the summaries.
  4. Frontend (Streamlit):

    • Chat Box UI:
      • Implement a chat interface where the user can type queries and receive answers in real time.
      • Handle the interaction flow between asking questions and displaying answers.
    • Display Suggested Questions:
      • Show a list of generated suggested questions to the user as a starter guide.
      • Allow users to click on a suggested question to automatically populate the query field.

Files to Create/Change:


Folder Structure to Follow:

src/
├── api/
│   ├── main.py
│   ├── routes/
│   │   └── chat.py
│   ├── models/
│   │   └── rag.py
│   ├── schemas/
│   │   └── chat.py
│   ├── dependencies/
│   │   └── rag.py
│   └── core/
│       ├── config.py
│       └── security.py
├── pipeline/
│   └── question_generator.py

Checklist:


Considerations:

Devasy23 commented 2 days ago

@say-het do you want to perform this task?