You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
4.1 KiB
112 lines
4.1 KiB
""" Information and constants are put here and imported into app.py. """ |
|
|
|
results_limit = 1000 |
|
|
|
party_colors = { |
|
"EPP": "#3399FF", |
|
"S&D": "#F0001C", |
|
"Renew": "gold", |
|
"ID": "#0E408A", |
|
"Greens/EFA": "#57B45F", |
|
"ECR": "#196CA8", |
|
"GUE/NGL": "#B71C1C", |
|
"NA": "grey", |
|
} |
|
|
|
|
|
# 50 % lighter party colors. |
|
party_colors_lighten = party_colors_lighten = { |
|
"EPP": "#f2f2f2", |
|
"S&D": "#ffe6e8", |
|
"Renew": "#f2f2f2", |
|
"ID": "#d6e6fa", |
|
"Greens/EFA": "#f2f2f2", |
|
"ECR": "#e6f0fa", |
|
"GUE/NGL": "#fce6e6", |
|
"The Left": "#fce6e6", |
|
"PPE": "#f2f2f2", |
|
'NA': "#D3D3D3", |
|
None: 'white' |
|
} |
|
|
|
|
|
parties = { |
|
"EPP": "Group of the European People's Party", |
|
"S&D": "Group of the Progressive Alliance of Socialists and Democrats", |
|
"RE": "Renew Europe Group", |
|
"Greens/EFA": "Group of the Greens/European Free Alliance", |
|
"ID": "Identity and Democracy Group", |
|
"ECR": "European Conservatives and Reformists Group", |
|
"GUE/NGL": "Group of the European United Left - Nordic Green Left", |
|
"NA": "Non-attached Members", |
|
"Renew": "Renew Europe Group", |
|
} |
|
|
|
|
|
css = """ <style> |
|
a:link { |
|
color: black; |
|
} |
|
a:visited { |
|
color: black; |
|
} |
|
a:hover { |
|
color: grey; |
|
} |
|
""" |
|
for p, c in party_colors.items(): # TODO Update for EU |
|
if p == "NYD": |
|
c = "#FFC000" |
|
if p == "SD": |
|
c = "#E5AC00" |
|
if p in ["", "-"]: |
|
c = "black" |
|
css += f"\n.{p} a{{color: {c};}}" |
|
css += "\n</style>" |
|
|
|
summary_note = """Below is a summary of what parliamentarians from the different parties has said. |
|
It's a summary of the ten most relevant speeches from each party based on the search you made. It's generated with a language model and not always accutarate. |
|
Please make sure to check the original text before you use the summary in any way. |
|
""" |
|
explainer = """This is a database of what members of the European Parliamen have said in various debates in the parliament since 2019. |
|
The data comes from the EU have been translated when not in English. |
|
- Start by typing one or more keywords below. You can use asterix (*), minus(-), quotation marks (""), OR and year\:yyyy-yyyy. The search |
|
`energy crisis* basic power OR nuclear power "fossil-free energy sources" -wind power year:2019-2022` is looking for quotes like\: |
|
- mentions "energy crisis" (incl. e.g. "energy crisis*") |
|
- mentions either "base power" *or* "nuclear power" |
|
- mentions the *exact phrase* "fossil-free energy sources" |
|
- *does* not mention "wind power" |
|
- found during the years 2019-2022 |
|
- You can also ask a specific quesion, like `What have parliamentarians said about the energy crisis?` Remember to put a question mark at the end of the question. |
|
- When you have received your results, you can filter on which years you are interested in. |
|
- Under "Excerpt" you can choose to see the entire speech in text, and under the text there are links to official protocol. |
|
|
|
Please tell us how you would like to use the data and about things that don't work. [Email me](mailto:lasse@edfast.se) or [write to me on Twitter](https://twitter.com/lasseedfast). |
|
My name is [Lasse Edfast and I'm a journalist](https://lasseedfast.se) based in Sweden. |
|
""" |
|
|
|
|
|
|
|
debate_types = { # TODO Update for EU |
|
"kam-vo": "Beslut", |
|
"bet": "Debatt om beslut", |
|
"kam-fs": "Frågestund", |
|
"kam-ar": "Information från regeringen", |
|
"ip": "Interpellationsdebatt", |
|
"kam-sf": "Statsministerns frågestund", |
|
"sam-ou": "Öppen utfrågning", |
|
"kam-ad": "Aktuell debatt", |
|
"kam-al": "Allmänpolitisk debatt", |
|
"kam-bu": "Budgetdebatt", |
|
"kam-bp": "Bordläggning", |
|
"kam-pd": "Partiledardebatt", |
|
"kam-dv": "Debatt med anledning av vårpropositionen", |
|
"sam-se": "Öppet seminarium", |
|
"kam-ud": "Utrikespolitisk debatt", |
|
} |
|
|
|
limit_warning = """ |
|
Your search returns more than 10,000 hits. Try making it more specific, for example by |
|
use a minus sign or specify the year by writing year\:yyyy-yyyy (eg year:2019-2020, without a space after the colon). |
|
The 10,000 hit limit is there to keep the server from crashing and will be raised when I have a stronger server. |
|
"""
|
|
|