Koshti10 commited on
Commit
cdc9be2
1 Parent(s): 968247b

Upload 82 files

Browse files
.gitattributes CHANGED
@@ -50,3 +50,6 @@ outputs/faiss/policy_mapred20/1/faiss_index/index.faiss filter=lfs diff=lfs merg
50
  outputs/faiss/policy_mapred20/3/faiss_index/index.faiss filter=lfs diff=lfs merge=lfs -text
51
  outputs/policy_eu_asia/1/faiss_index/index.faiss filter=lfs diff=lfs merge=lfs -text
52
  outputs/policy_eu_asia/3/faiss_index/index.faiss filter=lfs diff=lfs merge=lfs -text
 
 
 
 
50
  outputs/faiss/policy_mapred20/3/faiss_index/index.faiss filter=lfs diff=lfs merge=lfs -text
51
  outputs/policy_eu_asia/1/faiss_index/index.faiss filter=lfs diff=lfs merge=lfs -text
52
  outputs/policy_eu_asia/3/faiss_index/index.faiss filter=lfs diff=lfs merge=lfs -text
53
+ inputs/policy/USGOV2016[[:space:]]-[[:space:]]national[[:space:]]AI[[:space:]]strategic[[:space:]]plan.pdf filter=lfs diff=lfs merge=lfs -text
54
+ inputs/policy/USGOV2019[[:space:]]-[[:space:]]national[[:space:]]AI[[:space:]]strategic[[:space:]]plan.pdf filter=lfs diff=lfs merge=lfs -text
55
+ outputs/combined/policy_eu_asia_usa/faiss_index/index.faiss filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -6,7 +6,7 @@ from lc_base.chain import openai_chain
6
  import os
7
  from lc_base.logs import save_log
8
 
9
- dir = os.path.join("outputs", "combined", "policy_eu_asia", "faiss_index")
10
  # dir = os.path.join("outputs", "policy", "1", "faiss_index")
11
 
12
  title = """<h1 align="center">Chat</h1>"""
@@ -26,7 +26,7 @@ def respond(message, chat_history):
26
  output = chain.get_response(query=question, k=100, model_name="gpt-4-1106-preview", type="stuff")
27
  print(output)
28
  time_taken = time.time() - start_time
29
- save_log(file_path='logs/policy_combined_hf.csv', query=question, response=output, model_name="gpt-4-1106-preview", time_taken=time_taken, inp="Policy", data="Policy/1")
30
  bot_message = output
31
  chat_history.append((message, bot_message))
32
  time.sleep(2)
 
6
  import os
7
  from lc_base.logs import save_log
8
 
9
+ dir = os.path.join("outputs", "combined", "policy_eu_asia_usa", "faiss_index")
10
  # dir = os.path.join("outputs", "policy", "1", "faiss_index")
11
 
12
  title = """<h1 align="center">Chat</h1>"""
 
26
  output = chain.get_response(query=question, k=100, model_name="gpt-4-1106-preview", type="stuff")
27
  print(output)
28
  time_taken = time.time() - start_time
29
+ save_log(file_path='logs/policy_combined.csv', query=question, response=output, model_name="gpt-4-1106-preview", time_taken=time_taken, inp="Policy", data="Policy/1")
30
  bot_message = output
31
  chat_history.append((message, bot_message))
32
  time.sleep(2)
inputs/policy/USGOV2016 - national AI strategic plan.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e243785e2a96651e9306ab34252301d401885e730274cd872e19947161fc3b6
3
+ size 1912677
inputs/policy/USGOV2019 - national AI strategic plan.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38c18cdd1e651705bcff81737a47d5209218f61fb318d13b9e84a2cedea91ffd
3
+ size 1119368
inputs/policy/USGOV2023 - national AI strategic plan.pdf ADDED
Binary file (861 kB). View file
 
lc_base/save_db.py CHANGED
@@ -4,8 +4,9 @@ from database import Data
4
  import os
5
 
6
  # Store all reports into inp_dir and the generated DB for all reports will be saved in out_dir
7
- data = Data(inp_dir=os.path.join("inputs", "policy"), out_dir=os.path.join("outputs", "combined", "policy_eu_asia"))
8
  data.check_output()
9
  data.get_combined_faiss_embedding()
10
 
11
- #Length in Policy EU_Asia is 449198
 
 
4
  import os
5
 
6
  # Store all reports into inp_dir and the generated DB for all reports will be saved in out_dir
7
+ data = Data(inp_dir=os.path.join("inputs", "policy"), out_dir=os.path.join("outputs", "combined", "policy_eu_asia_usa"))
8
  data.check_output()
9
  data.get_combined_faiss_embedding()
10
 
11
+ #Length in Policy EU_Asia is 449198
12
+ #Length in policy Eu Asia USA is 967147
logs/policy_combined.csv CHANGED
@@ -1,5 +1,5 @@
1
- ,Unnamed: 0.2,Unnamed: 0.1,Unnamed: 0,query,response,model,querywords,responsewords,time,inputdir,datadir
2
- 0,0.0,0.0,,"What are the different AI policies/Strategies in India, China and European Union?","India, China, and the European Union each have their own distinct approaches to Artificial Intelligence (AI) policies and strategies, reflecting their unique priorities, aspirations, and societal contexts. Here is a brief overview of each:
3
 
4
  **India:**
5
  India has not released an official national AI policy but has a ""National Strategy on AI"" announced by NITI Aayog in 2018. The guiding principle of India's AI strategy is to leverage AI for social and inclusive growth, with the theme of #AIforAll. The strategy outlines objectives to promote economic growth and enhance the quality of life across key sectors, including healthcare, agriculture, education, smart cities and infrastructure, and smart mobility and transportation. Key tasks include promoting AI research, establishing a common data platform, and developing human resources for AI. India also emphasizes the need for responsible AI and active participation in global governance of AI.
@@ -11,7 +11,7 @@ China's AI policy is outlined in the ""New Generation of Artificial Intelligence
11
  The EU's approach to AI is encapsulated in the ""Coordinated Plan on Artificial Intelligence 2021 Review."" The plan aims to create EU global leadership in trustworthy AI by accelerating investments and aligning policy priorities and investments. The EU's strategy focuses on building an ecosystem of excellence and trust, nurturing AI talent and skills, developing a policy framework for trustworthy AI systems, and promoting sustainable and ethical AI both within the EU and globally. Sector-specific joint actions are proposed for high-impact areas such as climate and environment, health, robotics, public services, law enforcement, mobility, and agriculture. The EU emphasizes the need for human-centric AI that adheres to EU values and fundamental rights.
12
 
13
  Each of these regions' AI strategies reflects their respective economic, social, and geopolitical contexts, with India focusing on inclusive growth, China on global leadership and competitiveness, and the EU on ethical and trustworthy AI development.",gpt-4-1106-preview,81.0,2812.0,65.47135019302368,Policy,Policy/1
14
- 1,1.0,,,How will these Policies/Strategies affect each regions Economy in the future?,"I don't have the specific information on how the AI policies and strategies will affect each region's economy in the future. The impact of AI policies and strategies on regional economies can be complex and is influenced by a multitude of factors, including the level of investment, the ability to develop and attract talent, the degree of innovation and research, the existing industrial base, and how effectively AI is integrated into various sectors.
15
 
16
  Generally speaking, regions that prioritize AI in their policies and strategies might experience several potential economic effects:
17
 
@@ -32,7 +32,7 @@ Generally speaking, regions that prioritize AI in their policies and strategies
32
  8. Global Competitiveness: Regions that effectively implement AI strategies may become more competitive on the global stage, attracting businesses and talent.
33
 
34
  The exact outcomes will depend on how each region tailors its AI strategy to its unique economic context, the existing technological infrastructure, the level of public and private sector collaboration, and its approach to addressing the challenges associated with AI adoption.",gpt-4-1106-preview,77.0,2262.0,35.22081637382507,Policy,Policy/1
35
- 2,,,," Explain potential economic effects of using AI in India, China and European Union","The potential economic effects of using AI in India, China, and the European Union (EU) are multifaceted and have both positive and negative dimensions. Here's a summary of the potential economic impacts in each region:
36
 
37
  **India**:
38
  1. **Job Creation and Displacement**: AI is expected to create new job opportunities in technology sectors, but it may also displace jobs in industries relying on routine tasks. Upskilling and reskilling the workforce is necessary to manage this transition.
@@ -52,4 +52,19 @@ The exact outcomes will depend on how each region tailors its AI strategy to its
52
  3. **Digital Single Market**: The EU's approach to AI involves creating a digital single market, fostering collaboration, and ensuring ethical development and deployment of AI.
53
  4. **Resilience and Autonomy**: AI-powered robotics and automation can contribute to reshoring production, increasing the EU's autonomy in critical supply chains, and improving resilience.
54
 
55
- For all three regions, AI is generally seen as a transformative force that can drive future economic growth and competitiveness. However, each region approaches AI with different emphases based on their unique social, economic, and political landscapes. India focuses on AI for social good and inclusive growth, China on global competitiveness and industrial upgrade, and the EU on ethical AI that promotes excellence and trust.",gpt-4-1106-preview,82.0,3046.0,52.579426527023315,Policy,Policy/1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ,Unnamed: 0.3,Unnamed: 0.2,Unnamed: 0.1,Unnamed: 0,query,response,model,querywords,responsewords,time,inputdir,datadir
2
+ 0,0.0,0.0,0.0,,"What are the different AI policies/Strategies in India, China and European Union?","India, China, and the European Union each have their own distinct approaches to Artificial Intelligence (AI) policies and strategies, reflecting their unique priorities, aspirations, and societal contexts. Here is a brief overview of each:
3
 
4
  **India:**
5
  India has not released an official national AI policy but has a ""National Strategy on AI"" announced by NITI Aayog in 2018. The guiding principle of India's AI strategy is to leverage AI for social and inclusive growth, with the theme of #AIforAll. The strategy outlines objectives to promote economic growth and enhance the quality of life across key sectors, including healthcare, agriculture, education, smart cities and infrastructure, and smart mobility and transportation. Key tasks include promoting AI research, establishing a common data platform, and developing human resources for AI. India also emphasizes the need for responsible AI and active participation in global governance of AI.
 
11
  The EU's approach to AI is encapsulated in the ""Coordinated Plan on Artificial Intelligence 2021 Review."" The plan aims to create EU global leadership in trustworthy AI by accelerating investments and aligning policy priorities and investments. The EU's strategy focuses on building an ecosystem of excellence and trust, nurturing AI talent and skills, developing a policy framework for trustworthy AI systems, and promoting sustainable and ethical AI both within the EU and globally. Sector-specific joint actions are proposed for high-impact areas such as climate and environment, health, robotics, public services, law enforcement, mobility, and agriculture. The EU emphasizes the need for human-centric AI that adheres to EU values and fundamental rights.
12
 
13
  Each of these regions' AI strategies reflects their respective economic, social, and geopolitical contexts, with India focusing on inclusive growth, China on global leadership and competitiveness, and the EU on ethical and trustworthy AI development.",gpt-4-1106-preview,81.0,2812.0,65.47135019302368,Policy,Policy/1
14
+ 1,1.0,1.0,,,How will these Policies/Strategies affect each regions Economy in the future?,"I don't have the specific information on how the AI policies and strategies will affect each region's economy in the future. The impact of AI policies and strategies on regional economies can be complex and is influenced by a multitude of factors, including the level of investment, the ability to develop and attract talent, the degree of innovation and research, the existing industrial base, and how effectively AI is integrated into various sectors.
15
 
16
  Generally speaking, regions that prioritize AI in their policies and strategies might experience several potential economic effects:
17
 
 
32
  8. Global Competitiveness: Regions that effectively implement AI strategies may become more competitive on the global stage, attracting businesses and talent.
33
 
34
  The exact outcomes will depend on how each region tailors its AI strategy to its unique economic context, the existing technological infrastructure, the level of public and private sector collaboration, and its approach to addressing the challenges associated with AI adoption.",gpt-4-1106-preview,77.0,2262.0,35.22081637382507,Policy,Policy/1
35
+ 2,2.0,,,," Explain potential economic effects of using AI in India, China and European Union","The potential economic effects of using AI in India, China, and the European Union (EU) are multifaceted and have both positive and negative dimensions. Here's a summary of the potential economic impacts in each region:
36
 
37
  **India**:
38
  1. **Job Creation and Displacement**: AI is expected to create new job opportunities in technology sectors, but it may also displace jobs in industries relying on routine tasks. Upskilling and reskilling the workforce is necessary to manage this transition.
 
52
  3. **Digital Single Market**: The EU's approach to AI involves creating a digital single market, fostering collaboration, and ensuring ethical development and deployment of AI.
53
  4. **Resilience and Autonomy**: AI-powered robotics and automation can contribute to reshoring production, increasing the EU's autonomy in critical supply chains, and improving resilience.
54
 
55
+ For all three regions, AI is generally seen as a transformative force that can drive future economic growth and competitiveness. However, each region approaches AI with different emphases based on their unique social, economic, and political landscapes. India focuses on AI for social good and inclusive growth, China on global competitiveness and industrial upgrade, and the EU on ethical AI that promotes excellence and trust.",gpt-4-1106-preview,82.0,3046.0,52.57942652702332,Policy,Policy/1
56
+ 3,,,,,"What are the different AI policies/Strategies in India, China, European Union and USA?","India, China, the European Union (EU), and the United States (US) each have distinct approaches and strategies related to Artificial Intelligence (AI). Here's an overview of their AI policies/strategies:
57
+
58
+ **India:**
59
+ India's approach to AI is encapsulated in the ""National Strategy for Artificial Intelligence,"" released by NITI Aayog in 2018. The strategy focuses on leveraging AI for social inclusion and growth, with a vision of #AIforAll. It emphasizes the application of AI in key sectors such as healthcare, agriculture, education, smart cities and infrastructure, and smart mobility and transportation. The strategy also advocates for building AI research excellence, creating a data ecosystem, nurturing AI startups, and addressing ethical and legal issues related to AI.
60
+
61
+ **China:**
62
+ China’s ""New Generation of Artificial Intelligence Development Plan,"" released in 2017, outlines an ambitious roadmap to become a global leader in AI by 2030. The plan sets clear goals and milestones, emphasizing the strategic importance of AI in enhancing China's global competitiveness and national security. The policy outlines significant investments in AI research and development, the creation of AI innovation parks, and the development of AI skills among the workforce. China also aims to integrate AI in both civilian and military domains and has released principles for Responsible AI.
63
+
64
+ **European Union:**
65
+ The EU's ""Coordinated Plan on AI"" from 2018, updated in 2021, envisions establishing Europe as a leader in trustworthy and ethical AI. The plan calls for increased investment, alignment of AI policy to address global challenges, and the removal of fragmentation between EU and national AI actions. The EU emphasizes a human-centric, secure, sustainable, and inclusive approach to AI. The plan also sets out specific actions for collaboration, data sharing, and strategic leadership in high-impact sectors like health and climate.
66
+
67
+ **United States:**
68
+ The US has released the ""National AI R&D Strategic Plan"" in 2019, updating the initial 2016 plan. The strategic plan outlines priorities for federally funded AI research, focusing on long-term investments in AI, human-AI collaboration, understanding the ethical, legal, and societal implications of AI, ensuring the safety and security of AI systems, and developing shared datasets and environments for AI training and testing. The US strategy also emphasizes international collaboration in AI research and building a skilled AI workforce.
69
+
70
+ Each of these countries/regions has different priorities and approaches, reflecting their unique economic, social, and security contexts. While there is a common recognition of AI's potential across all strategies, the emphasis varies from inclusive growth and social challenges in India to global leadership and strategic advantage in China, ethical and trustworthy AI in the EU, and research and development with an eye on safeguarding ethical standards in the US.",gpt-4-1106-preview,86.0,2965.0,65.2707052230835,Policy,Policy/1
main.py CHANGED
@@ -11,17 +11,18 @@ from lc_base.database import Data
11
  from lc_base.logs import save_log
12
 
13
  # Store all reports into input_dir and the generated DB for all reports will be saved in output_dir
14
- input_dir = os.path.join("inputs", "policy")
15
- output_dir = os.path.join("outputs", "faiss", "policy_stuff70")
16
- combined_dir = os.path.join("outputs", "combined", "policy_stuff70", "faiss_index")
17
  search_type = "stuff" #map_reduce, stuff
18
  model_type = "gpt-4-1106-preview" #gpt-3.5-turbo, gpt-4-1106-preview
19
  top_k = 70
20
 
 
 
 
 
21
  default_query = '''
22
  Please generate a comprehensive summary of this document.
23
  Ensure the summary is presented in a formal style, and if there are any contradictions or variations in the findings,
24
- address them appropriately. The summary should be approximately 1/3 of your input and can be structured in paragraphs or bullet points.
25
  '''
26
 
27
  data = Data(inp_dir=input_dir, out_dir=output_dir)
 
11
  from lc_base.logs import save_log
12
 
13
  # Store all reports into input_dir and the generated DB for all reports will be saved in output_dir
 
 
 
14
  search_type = "stuff" #map_reduce, stuff
15
  model_type = "gpt-4-1106-preview" #gpt-3.5-turbo, gpt-4-1106-preview
16
  top_k = 70
17
 
18
+ input_dir = os.path.join("inputs", "policy")
19
+ output_dir = os.path.join("outputs", "faiss", "policy_eausa_stuff70")
20
+ combined_dir = os.path.join("outputs", "combined", "policy__eausa_stuff70", "faiss_index")
21
+
22
  default_query = '''
23
  Please generate a comprehensive summary of this document.
24
  Ensure the summary is presented in a formal style, and if there are any contradictions or variations in the findings,
25
+ address them appropriately. The summary should be approximately 1/6 of your input capacity and can be structured in paragraphs or bullet points.
26
  '''
27
 
28
  data = Data(inp_dir=input_dir, out_dir=output_dir)
outputs/combined/policy_eu_asia_usa/faiss_index/index.faiss ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d6482562dbaa34e72b71c686645b98fe56ffbcc90660dc8230313300111b266
3
+ size 7391277
outputs/combined/policy_eu_asia_usa/faiss_index/index.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:17296a745a621c58dd14e7db0837f3ba0e10feee12a0288c41512e24c91f292f
3
+ size 1285422