From 40b2a2088f1897966494eb5b293ca86c1a7c664e Mon Sep 17 00:00:00 2001 From: Paul Lam Date: Thu, 28 Sep 2023 11:36:32 +0900 Subject: [PATCH] display top keywords in welcome message --- mind_palace/app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mind_palace/app.py b/mind_palace/app.py index 8b91341..2fcc681 100644 --- a/mind_palace/app.py +++ b/mind_palace/app.py @@ -30,10 +30,14 @@ def load_nodes_and_index(xml_dir, model): query_engine = CitationQueryEngine.from_args(index=vector_index, verbose=True) -# TODO: pass in nodes instead of abstracts @st.cache_data(show_spinner="Summarizing papers... just a few more seconds.") def get_welcome_message(abstracts): - return welcome.summarize(gpt_model, abstracts) + return ( + welcome.summarize(gpt_model, abstracts) + + "\n\n" + + "Top keywords: " + + ", ".join(welcome.extract_keywords(gpt_model, abstracts)) + ) if "messages" not in st.session_state.keys(): # Initialize the chat messages history