import streamlit as st from pyserini.search.lucene import LuceneSearcher st.set_page_config( page_title="Reddit CMV", page_icon="📄", layout="centered" ) indexes = {"shoe-sizes": LuceneSearcher("index/cmv'-shoe-sizes-should-be-the-same-for-both-men-and-women"), "social-media": LuceneSearcher("index/cmv'-social-media-is-the-most-destructive-addiction-in-our-society"), "depression": LuceneSearcher("index/cmv'-the-others-have-it-worse-argument-is-terrible-and-should-never-be-used-in-an-actual-conversation-with-a-depressed-person"), "metric-system": LuceneSearcher("index/cmv'-there-shouldnt-be-anything-other-than-the-metric-system."), "best-time-period": LuceneSearcher("index/cmv'-today-is-the-best-time-period-in-human-history-to-be-alive-for-the-vast-majority-of-people."), } @st.cache(suppress_st_warning=True, allow_output_mutation=True, show_spinner=False) def search_chat_noir(key, search_query): return search(api_key=key, query=search_query) def result_html(result): return ( f"