"""CV Parser dashboard โ€” entry page. Run from the project root: streamlit run dashboard/app.py """ import streamlit as st import config from lib.ui import model_selector st.set_page_config(page_title="CV Parser Dashboard", page_icon="๐Ÿงฉ", layout="wide") def model_status_banner(lm): if lm.is_fallback: st.warning( f"**Demo mode โ€” no fine-tuned model loaded.** Source: `{lm.source}`. " "The classification head is untrained, so entity predictions are " "**not meaningful** yet. Publish a model from the **Manage Model** page " f"to `{config.PRIMARY_MODEL_ID}`, or pick one in the sidebar.", icon="โš ๏ธ", ) else: st.success(f"Model loaded โ€” {lm.source}", icon="โœ…") st.title("๐Ÿงฉ Automated CV Parser") st.caption("WQF7007 NLP ยท Resume NER ยท extracts Job Titles, Skills & Education") lm = model_selector() model_status_banner(lm) st.markdown( """ ### What's inside - **๐Ÿ”Ž Live Parser** โ€” paste or upload a single CV and watch it get **tokenized and classified** in real time: sub-word token chips coloured by predicted label, the original text with highlighted entities, and a clean structured summary. - **๐Ÿ“Š Analytics** โ€” upload a batch of CVs (PDF / DOCX / TXT) and the page builds a **skills word cloud** plus top Job Titles / Skills / Education charts across the set. Use the sidebar to switch pages. """ ) with st.expander("โ„น๏ธ How the model is resolved"): st.markdown( f""" The sidebar **Model** picker selects which weights run. Options: 1. **โญ Best model (Hub)** โ€” `{config.PRIMARY_MODEL_ID}`. The team's current best model; what the deployed app loads by default. 2. **Custom HF model ID** โ€” type any Hub repo id to load it live. 3. **Local export** โ€” `exported_models/โ€ฆ` folders (only on dev machines). 4. **Demo fallback** โ€” `{config.FALLBACK_MODEL}` with a random head (UI works, predictions don't). Teammates update the live model from the **๐Ÿ” Manage Model** page (uploads an exported model and pushes it to the Hub repo) โ€” no redeploy needed. After updating, click **๐Ÿ”„ Reload model** in the sidebar. Label scheme: `{', '.join(config.LABELS)}` """ )