A dynamic NewsAI dashboard that uses NLP to analyze news articles, visualize sentiment trends, and extract insights through interactive data visualizations.
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:
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.
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.
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.
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:
src/api/routes/chat.py
Defines the routes for the chat interface, including question answering and retrieving suggestions.
src/api/models/rag.py
The RAG pipeline, including the retrieval and generation logic for answering questions.
src/api/schemas/chat.py
Pydantic schemas for validating user queries and responses.
src/api/dependencies/rag.py
Dependencies for managing the retrieval and generation processes.
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:
Chat Box with RAG:
Suggested Questions:
Backend Implementation:
Frontend (Streamlit):
Files to Create/Change:
src/api/routes/chat.py
src/api/models/rag.py
src/api/schemas/chat.py
src/api/dependencies/rag.py
Folder Structure to Follow:
Checklist:
Considerations: