Spaces:
Running
Running
File size: 770 Bytes
7c17b1d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 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"])
|