Skip to content

Commit

Permalink
Update group representation
Browse files Browse the repository at this point in the history
Closes #148
  • Loading branch information
jmelot committed Oct 17, 2023
1 parent dc5d769 commit 478b230
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion web/gui-v2/src/static_data/data.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/gui-v2/src/static_data/overall_data.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"years": [2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023], "startArticleYear": 2019, "endArticleYear": 2022, "startPatentYear": 2017, "endPatentYear": 2020, "groups": ["sp500", "global500"]}
{"years": [2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023], "startArticleYear": 2019, "endArticleYear": 2022, "startPatentYear": 2017, "endPatentYear": 2020, "groups": {"sp500": "S&P 500", "global500": "Fortune Global 500"}}
12 changes: 11 additions & 1 deletion web/scripts/retrieve_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
APPLICATION_PATENT_CATEGORIES = {"Language_Processing", "Speech_Processing", "Knowledge_Representation", "Planning_and_Scheduling", "Control", "Distributed_AI", "Robotics", "Computer_Vision", "Analytics_and_Algorithms", "Measuring_and_Testing"}
INDUSTRY_PATENT_CATEGORIES = {"Physical_Sciences_and_Engineering", "Life_Sciences", "Security__eg_cybersecurity", "Transportation", "Industrial_and_Manufacturing", "Education", "Document_Mgt_and_Publishing", "Military", "Agricultural", "Computing_in_Government", "Personal_Devices_and_Computing", "Banking_and_Finance", "Telecommunications", "Networks__eg_social_IOT_etc", "Business", "Energy_Management", "Entertainment", "Nanotechnology", "Semiconductors"}

GROUPS_TO_NAMES = {
"sp500": "S&P 500",
"global500": "Fortune Global 500"
}

ARTICLE_METRICS = "articles"
PATENT_METRICS = "patents"
OTHER_METRICS = "other_metrics"
Expand Down Expand Up @@ -541,6 +546,11 @@ def clean_misc_fields(js: dict, refresh_images: bool, lowercase_to_orig_cname: d
js["crunchbase_description"] = js.pop("short_description")
js["crunchbase"] = clean_crunchbase(js["crunchbase"])
js["child_crunchbase"] = clean_crunchbase(js["child_crunchbase"])
group_keys_to_names = {
"sp500": "in_sandp_500",
"global500": "in_fortune_global_500"
}
js["groups"] = {k: js.pop(v, False) for k, v in group_keys_to_names.items()}
js.pop("grid")


Expand Down Expand Up @@ -692,7 +702,7 @@ def update_overall_data() -> None:
"endArticleYear": CURRENT_YEAR - 1,
"startPatentYear": CURRENT_YEAR - 6,
"endPatentYear": CURRENT_YEAR - 3,
"groups": ["sp500", "global500"]
"groups": GROUPS_TO_NAMES
}
with open(os.path.join(WEB_SRC_DIR, "static_data", "overall_data.json"), mode="w") as out:
out.write(json.dumps(overall_data))
Expand Down
6 changes: 4 additions & 2 deletions web/tests/test_data/alphabet_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
"https://www.linkedin.com/company/vicarious-ai",
"https://www.linkedin.com/company/verily"
],
"in_sandp_500": true,
"in_fortune_global_500": true,
"groups": {
"global500": true,
"sp500": true
},
"stage": "Mature",
"name": "Alphabet",
"patent_name": "alphabet",
Expand Down
6 changes: 4 additions & 2 deletions web/tests/test_data/hugging_face_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"linkedin": [
"https://www.linkedin.com/company/huggingface"
],
"in_sandp_500": false,
"in_fortune_global_500": false,
"groups": {
"global500": false,
"sp500": false
},
"stage": "Growth",
"name": "Hugging Face",
"patent_name": "hugging face",
Expand Down

0 comments on commit 478b230

Please sign in to comment.