File size: 2,207 Bytes
9249c61
 
bbfcb06
9249c61
 
 
57150e6
605f99d
 
 
 
 
 
 
 
 
 
 
769fd81
 
 
 
9249c61
 
 
 
 
605f99d
e605026
ae1aa6b
605f99d
695c876
605f99d
9249c61
ebb1ee0
ae1aa6b
9249c61
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import gradio as gr
import pandas as pd
import plotly.express as px

data = pd.read_csv('data/env_disclosure_data.csv')
data = data.drop('Unnamed: 0', axis=1)
data['Environmental Transparency'] = data['Environmental Transparency'].fillna('None')
data.Organization = data.Organization.replace('University of Montreal / Université de Montréal', 'University of Montreal')
data.Organization = data.Organization.replace('University of Washington,Allen Institute for AI', 'Allen Institute for AI')
data.Organization = data.Organization.replace('Allen Institute for AI,University of Washington', 'Allen Institute for AI')
data.Organization = data.Organization.replace(['Google', 'DeepMind', 'Google DeepMind','Google Brain','Google Research'], 'Alphabet')
data.Organization = data.Organization.replace(['Meta AI','Facebook AI Research','Facebook AI', 'Facebook'], 'Meta')
data.Organization = data.Organization.replace(['Microsoft','Microsoft Research'], 'Microsoft')

organizations=['Alphabet', 'OpenAI', 'Alibaba', 'Stanford University', 'University of Toronto','University of Toronto', 'Microsoft', 'NVIDIA',
               'Carnegie Mellon University (CMU)', 'University of Oxford','University of California (UC) Berkeley','Baidu','Anthropic',
               'Salesforce Research', 'Amazon', 'University of Montreal', 'Apple', 'Mistral AI', 'DeepSeek', 'Allen Institute for AI']

def generate_figure(org_name):
    org_data = data[data['Organization'] == org_name]
    fig = px.histogram(org_data, x="Year", color="Environmental Transparency")
    return fig

with gr.Blocks() as demo:
    gr.Markdown("# Environmental Transparency Explorer Tool")
    gr.Markdown("## Explore the data from 'Misinformation by Omission: The Need for More Environmental Transparency in AI'")
    with gr.Row():
        with gr.Column(scale=1):
            org_choice= gr.Dropdown(organizations, value="Alphabet", label="Organizations", info="Pick an organization to explore their environmental disclosures", interactive=True)

        with gr.Column(scale=4):
            fig = generate_figure(org_choice)
            gr.Plot(fig)

    org_choice.select(generate_figure, inputs=[org_choice], outputs=[fig])

demo.launch()