Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display top keywords in welcome message #41

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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