Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new classifiers 20241216 #499

Merged
merged 4 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions company_linkage/sql/ai_company_papers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ SELECT DISTINCT
year,
cv,
nlp,
robotics
robotics,
ai_safety,
llm
FROM
unnested_rors
INNER JOIN
Expand All @@ -26,7 +28,9 @@ SELECT
year,
cv,
nlp,
robotics
robotics,
ai_safety,
llm
FROM
staging_ai_companies_visualization.org_name_matches
INNER JOIN
Expand Down
16 changes: 13 additions & 3 deletions company_linkage/sql/ai_publications.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ WITH
merged_id,
cv_filtered,
nlp_filtered,
robotics_filtered
robotics_filtered,
ai_safety_predictions.preds = 1 AS ai_safety,
COALESCE(llm_classifier_predictions.label, FALSE) AS llm
FROM
gcp-cset-projects.article_classification.predictions
article_classification.predictions
LEFT JOIN
almanac_classifiers.llm_classifier_predictions
USING (merged_id)
LEFT JOIN
ai_safety_datasets.ai_safety_predictions
USING (merged_id)
WHERE
ai_filtered = TRUE OR cv_filtered = TRUE OR nlp_filtered = TRUE OR robotics_filtered = TRUE),
ror AS (
Expand All @@ -29,7 +37,9 @@ WITH
org_name,
cv_filtered as cv,
nlp_filtered as nlp,
robotics_filtered as robotics
robotics_filtered as robotics,
ai_safety,
llm
FROM
literature.affiliations
-- if they're AI papers
Expand Down
4 changes: 3 additions & 1 deletion company_linkage/sql/check_paper_counts_exist.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ WHERE
OR robotics_pubs IS NULL
OR cv_pubs IS NULL
OR nlp_pubs IS NULL
OR ai_safety_pubs IS NULL
OR llm_pubs IS NULL
OR ai_pubs_in_top_conferences IS NULL
OR all_pubs IS NULL
OR all_pubs IS NULL
22 changes: 19 additions & 3 deletions company_linkage/sql/initial_paper_visualization_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ WITH
cv,
nlp,
robotics,
ai_safety,
llm,
ref_id
FROM
staging_ai_companies_visualization.ai_company_papers
Expand All @@ -20,6 +22,8 @@ WITH
cv,
nlp,
robotics,
ai_safety,
llm,
ref_id,
year
FROM
Expand All @@ -37,7 +41,9 @@ WITH
COUNT(DISTINCT merged_id) AS ai_citation_count,
COUNT(DISTINCT IF(cv, merged_id, null)) AS cv_citation_count,
COUNT(DISTINCT IF(nlp, merged_id, null)) AS nlp_citation_count,
COUNT(DISTINCT IF(robotics, merged_id, null)) AS robotics_citation_count
COUNT(DISTINCT IF(robotics, merged_id, null)) AS robotics_citation_count,
COUNT(DISTINCT IF(ai_safety, merged_id, null)) AS ai_safety_citation_count,
COUNT(DISTINCT IF(llm, merged_id, null)) AS llm_citation_count
FROM
add_year
GROUP BY
Expand All @@ -61,7 +67,15 @@ all_cited as
ARRAY_AGG(STRUCT(year,
robotics_citation_count as num_papers)
ORDER BY
year) AS robotics_citation_count_by_year
year) AS robotics_citation_count_by_year,
ARRAY_AGG(STRUCT(year,
ai_safety_citation_count as num_papers)
ORDER BY
year) AS ai_safety_citation_count_by_year,
ARRAY_AGG(STRUCT(year,
llm_citation_count as num_papers)
ORDER BY
year) AS llm_citation_count_by_year
FROM
by_year
GROUP BY
Expand All @@ -71,7 +85,9 @@ SELECT
ai_citation_count_by_year,
cv_citation_count_by_year,
nlp_citation_count_by_year,
robotics_citation_count_by_year
robotics_citation_count_by_year,
ai_safety_citation_count_by_year,
llm_citation_count_by_year
FROM
high_resolution_entities.aggregated_organizations
LEFT JOIN
Expand Down
13 changes: 9 additions & 4 deletions company_linkage/sql/initial_visualization_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ WITH
merged_id,
cv,
nlp,
robotics
robotics,
ai_safety,
llm
FROM
staging_ai_companies_visualization.ai_company_papers),
rortable AS (
Expand All @@ -18,8 +20,9 @@ WITH
COUNT(DISTINCT merged_id) AS ai_pubs,
COUNT(DISTINCT CASE WHEN cv IS TRUE THEN merged_id END) as cv_pubs,
COUNT(DISTINCT CASE WHEN nlp IS TRUE THEN merged_id END) as nlp_pubs,
COUNT(DISTINCT CASE WHEN robotics IS TRUE THEN merged_id END) as robotics_pubs

COUNT(DISTINCT CASE WHEN robotics IS TRUE THEN merged_id END) as robotics_pubs,
COUNT(DISTINCT CASE WHEN ai_safety IS TRUE THEN merged_id END) as ai_safety_pubs,
COUNT(DISTINCT CASE WHEN llm IS TRUE THEN merged_id END) as llm_pubs
FROM aipubs
GROUP BY
CSET_id)
Expand Down Expand Up @@ -51,7 +54,9 @@ SELECT
COALESCE(ai_pubs, 0) as ai_pubs,
COALESCE(cv_pubs, 0) as cv_pubs,
COALESCE(nlp_pubs, 0) as nlp_pubs,
COALESCE(robotics_pubs, 0) as robotics_pubs
COALESCE(robotics_pubs, 0) as robotics_pubs,
COALESCE(ai_safety_pubs, 0) as ai_safety_pubs,
COALESCE(llm_pubs, 0) as llm_pubs
FROM
high_resolution_entities.aggregated_organizations
LEFT JOIN
Expand Down
20 changes: 17 additions & 3 deletions company_linkage/sql/visualization_data_with_by_year.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ WITH
year,
cv,
nlp,
robotics
robotics,
ai_safety,
llm
FROM
staging_ai_companies_visualization.ai_company_papers),
rortable AS (
Expand All @@ -20,7 +22,9 @@ WITH
COUNT(DISTINCT merged_id) AS ai_pubs,
COUNT(DISTINCT CASE WHEN cv IS TRUE THEN merged_id END) as cv_pubs,
COUNT(DISTINCT CASE WHEN nlp IS TRUE THEN merged_id END) as nlp_pubs,
COUNT(DISTINCT CASE WHEN robotics IS TRUE THEN merged_id END) as robotics_pubs
COUNT(DISTINCT CASE WHEN robotics IS TRUE THEN merged_id END) as robotics_pubs,
COUNT(DISTINCT CASE WHEN ai_safety IS TRUE THEN merged_id END) as ai_safety_pubs,
COUNT(DISTINCT CASE WHEN llm IS TRUE THEN merged_id END) as llm_pubs
FROM aipubs
WHERE year IS NOT NULL
GROUP BY
Expand All @@ -46,6 +50,14 @@ WITH
robotics_pubs as num_papers)
ORDER BY
year) AS robotics_pubs_by_year,
ARRAY_AGG(STRUCT(year,
ai_safety_pubs as num_papers)
ORDER BY
year) AS ai_safety_pubs_by_year,
ARRAY_AGG(STRUCT(year,
llm_pubs as num_papers)
ORDER BY
year) AS llm_pubs_by_year
FROM
high_resolution_entities.aggregated_organizations
LEFT JOIN
Expand All @@ -59,7 +71,9 @@ SELECT
ai_pubs_by_year,
cv_pubs_by_year,
nlp_pubs_by_year,
robotics_pubs_by_year
robotics_pubs_by_year,
ai_safety_pubs_by_year,
llm_pubs_by_year
FROM
staging_ai_companies_visualization.initial_visualization_data
LEFT JOIN
Expand Down
2 changes: 2 additions & 0 deletions web/gui-v2/src/components/DetailViewPublications.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ const DetailViewPublications = ({
{ text: "Computer vision", val: "cv_publications" },
{ text: "Natural language processing", val: "nlp_publications" },
{ text: "Robotics", val: "robotics_publications" },
{ text: "Large language models", val: "llm_publications" },
{ text: "AI safety", val: "ai_safety_publications" }
];

return (
Expand Down
2 changes: 1 addition & 1 deletion web/gui-v2/src/data/companies.json

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions web/gui-v2/src/static_data/table_columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,20 @@ const columnDefinitions = [
category: "publications",
...generateSliderColDef("articles", "robotics_publications"),
},
{
title: "AI safety publications",
key: "ai_safety_publications",
aggregateType: "median",
category: "publications",
...generateSliderColDef("articles", "ai_safety_publications"),
},
{
title: "Large language model publications",
key: "llm_publications",
aggregateType: "median",
category: "publications",
...generateSliderColDef("articles", "llm_publications"),
},
{
title: "All publications",
key: "all_pubs",
Expand Down
Loading
Loading