Skip to content

Commit

Permalink
Merge pull request #41 from TheDataGuild/feature/parse-keywords-2
Browse files Browse the repository at this point in the history
display top keywords in welcome message
  • Loading branch information
Quantisan authored Sep 28, 2023
2 parents 80a1a88 + 40b2a20 commit 0dcbaa9
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 0dcbaa9

Please sign in to comment.