Skip to content

Commit

Permalink
display top keywords in welcome message
Browse files Browse the repository at this point in the history
  • Loading branch information
Quantisan committed Sep 28, 2023
1 parent 80a1a88 commit 40b2a20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mind_palace/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 40b2a20

Please sign in to comment.