import streamlit as st import json from processor import process_new_documents st.title("📄 AI Document Summarizer") if st.button("🔄 Aggiorna Documenti"): process_new_documents() with open("document_store.json", "r") as f: docs = json.load(f) search = st.text_input("🔍 Cerca per parola chiave o titolo") for doc in docs: if search.lower() in doc["titolo"].lower() or any(search.lower() in k.lower() for k in doc["keywords"]): st.subheader(doc["titolo"]) st.markdown(f"[🔗 Apri documento]({doc['link']})") st.markdown(f"**Categoria:** {doc['category']}") st.markdown(f"**Data caricamento:** {doc['data_caricamento']}") st.markdown("**Riassunto:**") st.write(doc["summary"])