File size: 6,256 Bytes
e7185a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
import { useState } from "react";
import { media } from "./Utils/helper.js";
// import "primereact/resources/themes/lara-light-cyan/theme.css";
import './App.css'
import "primereact/resources/themes/lara-light-cyan/theme.css";
// import "primereact/resources/themes/bootstrap4-light-blue/theme.css"
import axios from "axios";
import {
  Routes,
  Route,
  Navigate,
  useLocation
} from "react-router-dom";
import { Home } from "./components/Home";
import { Request } from "./components/Request";
import { Leaderboard } from "./components/Leaderboard";
import Nav from "./styled_components/Nav";
import styled from "styled-components";
import { Toast } from "primereact/toast";
import { React, useRef, useEffect } from "react";
import { useContext } from "react";
import { DataContext } from "./DataContext";
import Logo from "./assets/logo.png"
import Metrics from "./components/Metrics";
import Dataset from "./components/Dataset";
import Contact from "./components/Contact";
import ProgressToast from "./styled_components/ProgressToast";
import SpinnerIcon from "./styled_components/SpinnerIcon";
import { Password } from 'primereact/password';

function App() {
  const toast = useRef(null);
  const [baseUrl, setBaseUrl] = useState("https://satyamr196-asr-fairbench-sever-v2.hf.space")
  // const [baseUrl,setBaseUrl] = useState("http://localhost:7860") 
  console.log(baseUrl);
  const location = useLocation();

  const showSucess = () => {//For toast
    toast.current.show({ severity: 'success', summary: 'Success', detail: 'Model added to Leaderboard πŸ€—' });
  };
  const showError = () => {//For toast
    toast.current.show({ severity: 'error', summary: 'Error', detail: 'Error adding model to Leaderboard πŸ₯Ή' });
  };
  const showInfo = () => {//For toast
    toast.current.show({ severity: 'info', summary: 'Info', detail: 'Model already added to the Leaderboard 🫒' });
  };
  return (
    <>  
      <Wrapper>
        <Toast ref={toast} />
        <HeadImg>
          <img src={Logo}></img>
        </HeadImg>
        <Text>
          πŸŽ™οΈ <b>ASR-FAIRBENCH</b> is an open benchmarking platform dedicated to evaluating the <b>fairness and accuracy</b> of Automatic Speech Recognition (ASR) models.
          Our mission is to assess ASR models' performance across diverse demographic groups using the <b><a href="https://ai.meta.com/datasets/speech-fairness-dataset/" target="_blank">Fair Speech Dataset</a></b>.

          Models are ranked based on the <b>Fairness Adjusted Accuracy Score (FAAS)</b>, which integrates both <b>Word Error Rate (WER)</b> and a <b>Fairness Score</b>, ensuring that models deliver equitable performance across different accents, genders, and age groups.

          Explore the πŸ“ˆ <b>Metrics</b> tab for details on our evaluation process and visit the πŸ“‚ <b>Dataset</b> tab for a summary of the Fair Speech Dataset.

          Think your ASR model is both inclusive and high-performing? Put it to the test and claim your spot on the leaderboard! ✨
          <b>πŸ“„<a href="http://arxiv.org/abs/2505.11572" target="_blank">(Paper Link)</a>  </b>&nbsp;
          <b><i className="pi pi-github"></i>  <a href="https://github.com/SatyamR196/ASR-FairBench" target="_blank">(Github Link)</a></b>
        </Text>
        <div className="container">
          <Nav />
          <Routes>
            <Route path="/home" element={<Home baseUrl={baseUrl} />} />
            <Route path="/request" element={<Request showSucess={showSucess} showError={showError} showInfo={showInfo} baseUrl={baseUrl} />} />
            <Route path="/leaderboard" element={<Leaderboard baseUrl={baseUrl} />} />
            <Route path="/metrics" element={<Metrics />} />
            <Route path="/dataset" element={<Dataset />} />
            <Route path="/contact" element={<Contact />} />
            <Route path="/*" element={<Navigate to="/leaderboard" />} />
          </Routes>
        </div>
      </Wrapper>

      <div style={{ display: location.pathname === "/request" ? "block" : "none" }}>
        <ProgressToast baseUrl={baseUrl} />
      </div>
    </>
  );
}

const HeadImg = styled.div`
display: flex;
justify-content: center; // Centers the image horizontally
align-items: center; // Aligns image vertically
width: 100%;
margin: 1rem 0 0 0;

img {
  max-width: 300px; // Adjust size as needed
  height: auto; // Maintain aspect ratio
}
`
const Text = styled.p`
  /* color: gray; */
  color: #4b5563; 
  padding-inline: 5rem;
  margin-top:0;
  margin-bottom:0;
  font-size:1.05rem !important ;
  @media ${media.tablet} {
    font-size: 14px;
    padding-inline: 2rem;
  }
  @media ${media.mobile} {
    font-size: 12px;
    padding-inline: 0.8rem;
  }
`

const Wrapper = styled.div`
  /* position: 'relative'; */
  /* background: linear-gradient(to right, #6dd5fa, #2980b9); */
  background-color: #ffffff;
  /* background-color: #fa2020; */
  color: black;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: left;
  align-items: left;
  text-align: left;
  font-family: Arial, sans-serif;

  .container {
    width: 90%;
    margin: auto;
    /* margin-top: 3rem; */
    padding: 2rem;
    background: transparent;
    /* background: rgb(255, 255, 255); */
    backdrop-filter: blur(12px);
    /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37); */
    border-radius: 20px;
    transition: transform 0.3s ease-in-out;
    @media ${media.tablet} {
      width: 95%;
      padding: 1.2rem;
    }
    @media ${media.mobile} {
      width: 98%;
      padding: 0.8rem;
    }
  }
  h1 {
    font-size: 3rem;
    color: #000000;
    /* color: #3b82f6; */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
  }
  h3{
    color: #000000;
  }
  p {
    /* font-size: 1.2rem; */
    /* color: #000000; */
    /* margin-bottom: 2rem; */
  }
  .graph-container {
    display: none;
    margin-top: 2rem;
    text-align: center;
  }
  canvas {
    margin: 20px auto;
    max-width: 600px;
  }
  hr {
    margin: 1.5px 0;
    border: none;
    border-top: 1.5px solid rgba(25, 75, 255, 0.7);
  }
  input {
    padding: 10px;
    /* margin-bottom: 20px; */
    border: none;
    border-radius: 10px;
    /* width: 65%; */
    text-align: center;
  }
`;

export default App;