Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- .gitignore +6 -0
- .streamlit/config.toml +6 -0
- README.md +7 -6
- app.py +66 -0
- atlasia_white_wtext_nobg.png +0 -0
- requirements.txt +3 -0
.gitignore
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.venv/
|
2 |
+
venv/
|
3 |
+
*.ipynb
|
4 |
+
data/
|
5 |
+
.vscode/
|
6 |
+
img/
|
.streamlit/config.toml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[theme]
|
2 |
+
base="dark"
|
3 |
+
primaryColor="#ffffff"
|
4 |
+
backgroundColor="#2a3a4a"
|
5 |
+
secondaryBackgroundColor="#2a3a4a"
|
6 |
+
font="serif"
|
README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1 |
---
|
2 |
-
title: AtlasIA
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
-
sdk:
|
7 |
-
sdk_version:
|
8 |
app_file: app.py
|
9 |
pinned: false
|
|
|
10 |
---
|
11 |
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: AtlasIA-Dashboard
|
3 |
+
emoji: π
|
4 |
+
colorFrom: gray
|
5 |
+
colorTo: blue
|
6 |
+
sdk: streamlit
|
7 |
+
sdk_version: 1.30.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
+
license: mit
|
11 |
---
|
12 |
|
13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from datasets import load_dataset
|
3 |
+
import pandas as pd
|
4 |
+
import plotly.graph_objects as go
|
5 |
+
|
6 |
+
|
7 |
+
@st.cache_data
|
8 |
+
def fetch_counts():
|
9 |
+
dataset = load_dataset("atlasia/darija-translation", split="train")
|
10 |
+
dataset = pd.DataFrame(dataset)
|
11 |
+
n_eng = len(dataset["en"].dropna())
|
12 |
+
n_fr = len(dataset["fr"].dropna())
|
13 |
+
n = len(dataset)
|
14 |
+
return {"n_eng": n_eng, "n_fr": n_fr, "n": n}
|
15 |
+
|
16 |
+
|
17 |
+
if __name__ == "__main__":
|
18 |
+
st.image("atlasia_white_wtext_nobg.png")
|
19 |
+
|
20 |
+
counts = fetch_counts()
|
21 |
+
n_goal = 40000
|
22 |
+
total_submissions = counts["n"]
|
23 |
+
|
24 |
+
st.text("")
|
25 |
+
# center text
|
26 |
+
st.markdown(
|
27 |
+
"""
|
28 |
+
<h1 style='text-align: center; font-size: 20px;'>
|
29 |
+
Help building a Darija
|
30 |
+
dataset for all Moroccans.
|
31 |
+
Contribute here: <a href="https://atlasia.ma" target="_blank">atlasia.ma</a>
|
32 |
+
</h1>
|
33 |
+
""",
|
34 |
+
unsafe_allow_html=True,
|
35 |
+
)
|
36 |
+
|
37 |
+
# make progress chart
|
38 |
+
fig = go.Figure(
|
39 |
+
go.Indicator(
|
40 |
+
domain={"x": [0, 1], "y": [0, 1]},
|
41 |
+
value=total_submissions,
|
42 |
+
mode="gauge+number+delta",
|
43 |
+
title={"text": "Number of translations"},
|
44 |
+
delta={"reference": 0},
|
45 |
+
gauge={
|
46 |
+
"axis": {"range": [0, n_goal]},
|
47 |
+
"steps": [
|
48 |
+
{"range": [0, total_submissions], "color": "gray"},
|
49 |
+
],
|
50 |
+
"threshold": {
|
51 |
+
"line": {"color": "green", "width": 4},
|
52 |
+
"thickness": 0.75,
|
53 |
+
"value": n_goal / 2,
|
54 |
+
},
|
55 |
+
},
|
56 |
+
)
|
57 |
+
)
|
58 |
+
|
59 |
+
st.plotly_chart(fig, use_container_width=True)
|
60 |
+
|
61 |
+
labels = ["English", "French"]
|
62 |
+
values = [counts["n_eng"], counts["n_fr"]]
|
63 |
+
# change color to blue and white
|
64 |
+
fig = go.Figure(data=[go.Pie(labels=labels, values=values, pull=[0.2, 0])])
|
65 |
+
fig.update_traces(marker=dict(colors=["#46607b", "#FFFFFF"]))
|
66 |
+
st.plotly_chart(fig, use_container_width=True)
|
atlasia_white_wtext_nobg.png
ADDED
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
plotly==5.20.0
|
2 |
+
datasets==2.18.0
|
3 |
+
pandas==2.2.1
|