Spaces:
Running
Running
| 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"]) | |