# Short summary: In 2020, Parliamentarian NN, ({party}) wanted to decrease the budget for the EU parliament. Later, 2022, she wanted to incrase the budget.
returnget_data(f'''for doc in speeches filter doc._id in {list(docs_ids)} return {{{strings['arango']['select_fields']}}}''')
###* PAGE LOADS *###
# Title and explainer for streamlit
@ -680,11 +672,7 @@ partycodes = list(party_colors.keys()) # List of partycodes
return_limit=10000
# Initialize LLM model.
#llama = LLM(temperature=0.5)
# Get strings from yaml file.
withopen('strings.yml','r')asf:
strings=yaml.safe_load(f)
llama=LLM(temperature=0.5)
# Ask for word to search for.
user_input=st.text_input(
@ -692,60 +680,56 @@ user_input = st.text_input(
value=params.q,
placeholder="Search something",
# label_visibility="hidden",
help='You can use asterix (*), minus (-), quotationmarks ("") and OR.\nYou can also try asking a question, like *What is the Parliament doing for the climate?*',
)
help='''You can use asterix (*), minus (-), quotationmarks ("") and OR.
# print(llama.generate(prompt=f'''A user wants to search in a database containing debates in the European Parliament and have made the input below. Take that input and write three questions would generate a good result if used for quering a vector database. Answer with a python style list containing the three questions.
-Under"Longer excerpt"youcanchoosetoseetheentirespeechintext,andunderthetexttherearelinkstotheRiksdag's Web TV and downloadable audio (in the cases
wherethedebatehasbeenbroadcast).
Pleasetellushowyouwouldliketousethedataandaboutthingsthatdon't work. [Email me](mailto:lasse@edfast.se) or [write to me on Twitter](https://twitter.com/lasseedfast).
Mynameis[LasseEdfastandI'm a journalist](https://lasseedfast.se) based in Sweden.
# If it does, add the current chunk to the chunks list and start a new chunk with the current sentence.
chunks.append(current_chunk)
current_chunk=sentence
# Add the last chunk to the chunks list.
ifcurrent_chunk:
chunks.append(current_chunk)
else:
chunks=[text]
returnchunks
parliamentary_term_now=9#* Update this every term.
model_mistral="mistral-openorca"
eu_country_codes={
"Belgium":"BE",
"Greece":"EL",
"Lithuania":"LT",
"Portugal":"PT",
"Bulgaria":"BG",
"Spain":"ES",
"Luxembourg":"LU",
"Romania":"RO",
"Czechia":"CZ",
"France":"FR",
"Hungary":"HU",
"Slovenia":"SI",
"Denmark":"DK",
"Croatia":"HR",
"Malta":"MT",
"Slovakia":"SK",
"Germany":"DE",
"Italy":"IT",
"Netherlands":"NL",
"Finland":"FI",
"Estonia":"EE",
"Cyprus":"CY",
"Austria":"AT",
"Sweden":"SE",
"Ireland":"IE",
"Latvia":"LV",
"Poland":"PL",
}
country_flags={
"United Kingdom":"🇬🇧",
"Sweden":"🇸🇪",
"Spain":"🇪🇸",
"Slovenia":"🇸🇮",
"Slovakia":"🇸🇰",
"Romania":"🇷🇴",
"Portugal":"🇵🇹",
"Poland":"🇵🇱",
"Netherlands":"🇳🇱",
"Malta":"🇲🇹",
"Luxembourg":"🇱🇺",
"Lithuania":"🇱🇹",
"Latvia":"🇱🇻",
"Italy":"🇮🇹",
"Ireland":"🇮🇪",
"Hungary":"🇭🇺",
"Greece":"🇬🇷",
"Germany":"🇩🇪",
"France":"🇫🇷",
"Finland":"🇫🇮",
"Estonia":"🇪🇪",
"Denmark":"🇩🇰",
"Czechia":"🇨🇿",
"Cyprus":"🇨🇾",
"Croatia":"🇭🇷",
"Bulgaria":"🇧🇬",
"Belgium":"🇧🇪",
"Austria":"🇦🇹",
}
policy_areas=[
"Agriculture",
"Business",
"Industry",
"Climate",
"Culture",
"Customs",
"Development",
"Education",
"Employment",
"Social Affairs",
"Energy",
"Environment",
"FoodSafety",
"SecurityPolicy",
"Health",
"Democracy",
"Humanitarian Aid",
"Justice",
"Research And Innovation",
"Market",
"Taxation",
"Trade",
"Transport",
]
# From https://eur-lex.europa.eu/browse/summaries.html
policy_areas=['Agriculture',' Audiovisual and media',' Budget',' Competition',' Consumers',' Culture',' Customs',' Development',' Digital single market',' Economic and monetary affairs',' Education, training, youth, sport',' Employment and social policy',' Energy',' Enlargement',' Enterprise',' Environment and climate change',' External relations',' External trade',' Food safety',' Foreign and security policy',' Fraud and corruption',' Humanitarian Aid and Civil Protection',' Human rights',' Institutional affairs',' Internal market',' Justice, freedom and security',' Oceans and fisheries',' Public health',' Regional policy',' Research and innovation',' Taxation',' Transport']