Skip to content

Build Streamlit UI prototype #35

@justinmadison

Description

@justinmadison

Summary

Create a Streamlit-based prototype to expose core NLP features (QA, summarization, sentiment, entity lookup) via a simple web UI.

Motivation

  • Quickly validate user flows and UX before investing in a full React/FastAPI frontend.
  • Allow interns to see end-to-end integration of pipeline functions in a live interface.
  • Iterate rapidly on feature set based on user feedback.

Scope

In scope: implementation, tests

Acceptance Criteria

  • Streamlit app launches and sidebar navigation works
  • QA page returns answer & snippets for a sample query
  • Summarization page generates a TL;DR for a sample article
  • Sentiment page displays label & score for a sample article
  • Entities page lists extracted entities by type
  • /ui/README.md clearly explains installation, run command, and feature usage

Additional Context

Details

  • Category: ui

  • Priority: P1

  • Estimate: 2d

  • Dependencies:

    • Core NLP functions available: retrieve_context, generate_answer, summarize, analyze_sentiment, extract_entities
    • streamlit added to /ui/requirements.txt
    • Database connection module (nlp/db.py)
  • Prototype feature set:

    1. Question-Answering: text input for question, slider for top_k, displays answer + source snippets
    2. Summarization: select article or paste text, button to generate TL;DR
    3. Sentiment: select article, button to show sentiment label & score
    4. Entity Lookup: select article, display detected entities by type
    5. Navigation: sidebar menu to switch between features

Tasks

  1. Add dependencies
    • Add streamlit to /ui/requirements.txt.
  2. Prototype app
    • Create /ui/streamlit_app.py that:
      • Imports core functions from nlp/core.py
      • Uses streamlit.sidebar.selectbox for feature selection
      • For each feature, uses the appropriate widgets (text_input, slider, button, write) to capture inputs and display outputs
  3. Run instruction
    • Document:
      streamlit run ui/streamlit_app.py
      
  4. Smoke test
    • Verify the app launches locally and each feature page loads without errors
  5. Documentation
    • Update /ui/README.md with setup steps, run command, and screenshots of each feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions