Mjlehtim commited on
Commit
b7cb49b
Β·
verified Β·
1 Parent(s): 92d41cd

# data and # resources clear deleted

Browse files
Files changed (1) hide show
  1. app.py +12 -15
app.py CHANGED
@@ -124,11 +124,11 @@ doc_retriever_financials = None
124
  def load_or_parse_data_ESG():
125
  data_file = "./data/parsed_data_ESG.pkl"
126
 
127
- parsingInstructionUber10k = """The provided document contain detailed information about the company's environmental, social and governance matters.
128
- It contains several tables, figures and statistical information about CO2 emissions and energy consumption.
129
- Give only precide CO2 and energy consumption levels inly from the context documents.
130
- You must never provide false numeric or statistical data that is not included in the context document.
131
- Include tables and numeric data always when possible. Only refer to other sources if the context document refers to them or if necessary to provide additional understanding to company's own data."""
132
 
133
  parser = LlamaParse(api_key=LLAMA_PARSE_API_KEY,
134
  result_type="markdown",
@@ -154,7 +154,7 @@ def load_or_parse_data_financials():
154
  data_file = "./data/parsed_data_financials.pkl"
155
 
156
  parsingInstructionUber10k = """The provided document is the company's annual reports and includes financial statement, balance sheet, cash flow sheet and description of the company's business and operations.
157
- It contains several tabless, figures and statistical information. You must be precise while answering the questions and never provide false numeric or statistical data."""
158
 
159
  parser = LlamaParse(api_key=LLAMA_PARSE_API_KEY,
160
  result_type="markdown",
@@ -243,7 +243,6 @@ def create_vector_database_financials():
243
 
244
  #--------------
245
  ESG_analysis_button_key = "ESG_strategy_button"
246
- portfolio_analysis_button_key = "portfolio_strategy_button"
247
 
248
  #---------------
249
  def delete_files_and_folders(folder_path):
@@ -302,13 +301,13 @@ def ESG_strategy():
302
  ESG_answer_1 = qa.invoke("Give a summary what specific ESG measures the company has taken recently and compare these to the best practices.")
303
  ESG_answer_2 = qa.invoke("Does the company's main business fall under the European Union's taxonomy regulation? Answer whether the company is taxonomy compliant under European Union Taxonomy Regulation?")
304
  ESG_answer_3 = qa.invoke("Describe what specific ESG transparency commitments the company has given. Give details how the company has followed the Paris Treaty's obligation to limit globabl warming to 1.5 celcius degrees.")
305
- ESG_answer_4 = qa.invoke("Does the company have carbon emissions reduction plan? Has the company reached its carbod dioxide reduction objectives? Set out in a table the company's carbon footprint by location and its development or equivalent figures. List carbon dioxide emissions in relation to turnover.")
306
  ESG_answer_5 = qa.invoke("Describe and set out in a table the following specific information: (i) Scope 1 CO2 emissions, (ii) Scope 2 CO2 emissions, and (iii) Scope 3 CO2 emissions of the company for 2021, 2022 and 2023. List the material changes relating to these figures.")
307
  ESG_answer_6 = qa.invoke("List in a table the company's energy and renewable energy usage for each material activity. Explain the main energy efficiency measures taken by the company.")
308
  ESG_answer_7 = qa.invoke("Does the company follow UN Guiding Principles on Business and Human Rights, ILO Declaration on Fundamental Principles and Rights at Work or OECD Guidelines for Multinational Enterprises that involve affected communities?")
309
- ESG_answer_8 = qa.invoke("List the environmental permits and certifications held by the company. Set out and explain any environmental procedures and investigations and decisions taken against the company. Answer whether the company's locations or operations are connected to areas sensitive in relation to biodiversity.")
310
  ESG_answer_9 = qa.invoke("Set out waste management produces by the company and possible waste into the soil. Describe if the company's real estates have hazardous waste.")
311
- ESG_answer_10 = qa.invoke("What percentage of women are represented in the (i) board, (ii) executive directors and (iii) upper management? Set out the measures taken to have the gender balance on the upper management of the company.")
312
  ESG_answer_11 = qa.invoke("What policies has the company implemented to counter money laundering and corruption?")
313
 
314
  ESG_output = f"**__Summary of ESG reporting and obligations:__** {ESG_answer_1} \n\n **__Compliance with taxonomy:__** \n\n {ESG_answer_2} \n\n **__Disclosure transparency:__** \n\n {ESG_answer_3} \n\n **__Carbon footprint:__** \n\n {ESG_answer_4} \n\n **__Carbon dioxide emissions:__** \n\n {ESG_answer_5} \n\n **__Renewable energy:__** \n\n {ESG_answer_6} \n\n **__Human rights compliance:__** \n\n {ESG_answer_7} \n\n **__Management and gender balance:__** \n\n {ESG_answer_8} \n\n **__Waste and other emissions:__** {ESG_answer_9} \n\n **__Gender equality:__** {ESG_answer_10} \n\n **__Anti-money laundering:__** {ESG_answer_11}"
@@ -400,16 +399,14 @@ with strategies_container:
400
  st.session_state.button_states = {
401
  "ESG_analysis_button_key": False,
402
  }
403
- st.session_state.button_states = {
404
- "portfolio_analysis_button_key": False,
405
- }
406
  st.session_state.results = {}
407
 
408
  st.session_state['history'] = []
409
  st.session_state['generated'] = ["Let's discuss the ESG issues of the company πŸ€—"]
410
  st.session_state['past'] = ["Hey ! πŸ‘‹"]
411
- st.cache_data.clear()
412
- st.cache_resource.clear()
413
 
414
  # Check if the subfolder exists
415
  if os.path.exists("ESG_Documents"):
 
124
  def load_or_parse_data_ESG():
125
  data_file = "./data/parsed_data_ESG.pkl"
126
 
127
+ parsingInstructionUber10k = """The provided document contains detailed information about the company's environmental, social, and governance matters.
128
+ It contains several tables, figures, and statistical information about CO2 emissions and energy consumption.
129
+ Give only precise CO2 and energy consumption levels from the context documents.
130
+ You must never provide false numeric or statistical data not included in the context document.
131
+ Include tables and numeric data always when possible. Only refer to other sources if the context document refers to them or if necessary to provide additional understanding to the company's own data."""
132
 
133
  parser = LlamaParse(api_key=LLAMA_PARSE_API_KEY,
134
  result_type="markdown",
 
154
  data_file = "./data/parsed_data_financials.pkl"
155
 
156
  parsingInstructionUber10k = """The provided document is the company's annual reports and includes financial statement, balance sheet, cash flow sheet and description of the company's business and operations.
157
+ It contains several tables, figures and statistical information. You must be precise while answering the questions and never provide false numeric or statistical data."""
158
 
159
  parser = LlamaParse(api_key=LLAMA_PARSE_API_KEY,
160
  result_type="markdown",
 
243
 
244
  #--------------
245
  ESG_analysis_button_key = "ESG_strategy_button"
 
246
 
247
  #---------------
248
  def delete_files_and_folders(folder_path):
 
301
  ESG_answer_1 = qa.invoke("Give a summary what specific ESG measures the company has taken recently and compare these to the best practices.")
302
  ESG_answer_2 = qa.invoke("Does the company's main business fall under the European Union's taxonomy regulation? Answer whether the company is taxonomy compliant under European Union Taxonomy Regulation?")
303
  ESG_answer_3 = qa.invoke("Describe what specific ESG transparency commitments the company has given. Give details how the company has followed the Paris Treaty's obligation to limit globabl warming to 1.5 celcius degrees.")
304
+ ESG_answer_4 = qa.invoke("Does the company have carbon emissions reduction plan? Has the company reached its carbon dioxide reduction objectives? Set the company's carbon footprint by location and its development or equivalent figures in a table. List carbon dioxide emissions compared to turnover.")
305
  ESG_answer_5 = qa.invoke("Describe and set out in a table the following specific information: (i) Scope 1 CO2 emissions, (ii) Scope 2 CO2 emissions, and (iii) Scope 3 CO2 emissions of the company for 2021, 2022 and 2023. List the material changes relating to these figures.")
306
  ESG_answer_6 = qa.invoke("List in a table the company's energy and renewable energy usage for each material activity. Explain the main energy efficiency measures taken by the company.")
307
  ESG_answer_7 = qa.invoke("Does the company follow UN Guiding Principles on Business and Human Rights, ILO Declaration on Fundamental Principles and Rights at Work or OECD Guidelines for Multinational Enterprises that involve affected communities?")
308
+ ESG_answer_8 = qa.invoke("List the environmental permits and certifications held by the company. Set out and explain any environmental procedures, investigations, and decisions taken against the company. Answer whether the company's locations or operations are connected to areas sensitive in relation to biodiversity.")
309
  ESG_answer_9 = qa.invoke("Set out waste management produces by the company and possible waste into the soil. Describe if the company's real estates have hazardous waste.")
310
+ ESG_answer_10 = qa.invoke("What percentage of women are represented in the (i) board, (ii) executive directors, and (iii) upper management? Set out the measures taken to have the gender balance on the upper management of the company.")
311
  ESG_answer_11 = qa.invoke("What policies has the company implemented to counter money laundering and corruption?")
312
 
313
  ESG_output = f"**__Summary of ESG reporting and obligations:__** {ESG_answer_1} \n\n **__Compliance with taxonomy:__** \n\n {ESG_answer_2} \n\n **__Disclosure transparency:__** \n\n {ESG_answer_3} \n\n **__Carbon footprint:__** \n\n {ESG_answer_4} \n\n **__Carbon dioxide emissions:__** \n\n {ESG_answer_5} \n\n **__Renewable energy:__** \n\n {ESG_answer_6} \n\n **__Human rights compliance:__** \n\n {ESG_answer_7} \n\n **__Management and gender balance:__** \n\n {ESG_answer_8} \n\n **__Waste and other emissions:__** {ESG_answer_9} \n\n **__Gender equality:__** {ESG_answer_10} \n\n **__Anti-money laundering:__** {ESG_answer_11}"
 
399
  st.session_state.button_states = {
400
  "ESG_analysis_button_key": False,
401
  }
402
+
 
 
403
  st.session_state.results = {}
404
 
405
  st.session_state['history'] = []
406
  st.session_state['generated'] = ["Let's discuss the ESG issues of the company πŸ€—"]
407
  st.session_state['past'] = ["Hey ! πŸ‘‹"]
408
+ #st.cache_data.clear()
409
+ #st.cache_resource.clear()
410
 
411
  # Check if the subfolder exists
412
  if os.path.exists("ESG_Documents"):