Spaces:
Sleeping
Sleeping
Rijgersberg
commited on
Commit
β’
2e8bf47
1
Parent(s):
c79bd97
Translate
Browse files
app.py
CHANGED
@@ -84,7 +84,7 @@ def donut_chart_total() -> alt.Chart:
|
|
84 |
source = pd.DataFrame(
|
85 |
{
|
86 |
"values": [annotated_records, pending_records],
|
87 |
-
"category": ["
|
88 |
"colors": ["#4CAF50", "#757575"], # Green for Completed, Grey for Remaining
|
89 |
}
|
90 |
)
|
@@ -123,7 +123,7 @@ def donut_chart_target() -> alt.Chart:
|
|
123 |
source = pd.DataFrame(
|
124 |
{
|
125 |
"values": [annotated_records, pending_records],
|
126 |
-
"category": ["
|
127 |
"colors": ["#4CAF50", "#757575"], # Green for Completed, Grey for Remaining
|
128 |
}
|
129 |
)
|
@@ -154,14 +154,14 @@ def kpi_chart_remaining() -> alt.Chart:
|
|
154 |
|
155 |
pending_records = int(os.getenv("TARGET_RECORDS")) - len(target_dataset)
|
156 |
# Assuming you have a DataFrame with user data, create a sample DataFrame
|
157 |
-
data = pd.DataFrame({"Category": ["
|
158 |
|
159 |
# Create Altair chart
|
160 |
chart = (
|
161 |
alt.Chart(data)
|
162 |
.mark_text(fontSize=100, align="center", baseline="middle", color="steelblue")
|
163 |
.encode(text="Value:N")
|
164 |
-
.properties(title="
|
165 |
)
|
166 |
|
167 |
return chart
|
@@ -177,14 +177,14 @@ def kpi_chart_submitted() -> alt.Chart:
|
|
177 |
total = len(target_dataset)
|
178 |
|
179 |
# Assuming you have a DataFrame with user data, create a sample DataFrame
|
180 |
-
data = pd.DataFrame({"Category": ["
|
181 |
|
182 |
# Create Altair chart
|
183 |
chart = (
|
184 |
alt.Chart(data)
|
185 |
.mark_text(fontSize=100, align="center", baseline="middle", color="steelblue")
|
186 |
.encode(text="Value:N")
|
187 |
-
.properties(title="
|
188 |
)
|
189 |
|
190 |
return chart
|
@@ -203,7 +203,7 @@ def kpi_chart() -> alt.Chart:
|
|
203 |
|
204 |
# Assuming you have a DataFrame with user data, create a sample DataFrame
|
205 |
data = pd.DataFrame(
|
206 |
-
{"Category": ["
|
207 |
)
|
208 |
|
209 |
# Create Altair chart
|
@@ -211,7 +211,7 @@ def kpi_chart() -> alt.Chart:
|
|
211 |
alt.Chart(data)
|
212 |
.mark_text(fontSize=100, align="center", baseline="middle", color="steelblue")
|
213 |
.encode(text="Value:N")
|
214 |
-
.properties(title="
|
215 |
)
|
216 |
|
217 |
return chart
|
@@ -234,7 +234,7 @@ def obtain_top_5_users(user_ids_annotations: Dict[str, int]) -> pd.DataFrame:
|
|
234 |
"""
|
235 |
|
236 |
dataframe = pd.DataFrame(
|
237 |
-
user_ids_annotations.items(), columns=["
|
238 |
)
|
239 |
dataframe["Name"] = dataframe["Name"].apply(render_hub_user_link)
|
240 |
dataframe = dataframe.sort_values(by="Submitted Responses", ascending=False)
|
@@ -296,40 +296,24 @@ def main() -> None:
|
|
296 |
with gr.Blocks(css=css) as demo:
|
297 |
gr.Markdown(
|
298 |
"""
|
299 |
-
#
|
300 |
|
301 |
-
|
302 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
"""
|
304 |
)
|
305 |
|
306 |
-
# gr.Markdown(
|
307 |
-
# f"""
|
308 |
-
# ## π Target for Releasing Dataset v2
|
309 |
-
# How close are we to the target for version 2.0?
|
310 |
-
# """
|
311 |
-
# )
|
312 |
-
# with gr.Row():
|
313 |
-
|
314 |
-
# donut_target_plot = gr.Plot(label="Plot")
|
315 |
-
# demo.load(
|
316 |
-
# donut_chart_target,
|
317 |
-
# inputs=[],
|
318 |
-
# outputs=[donut_target_plot],
|
319 |
-
# every=update_interval_charts,
|
320 |
-
# )
|
321 |
-
|
322 |
-
# gr.Markdown(
|
323 |
-
# f"""
|
324 |
-
# ## π Target for Releasing Dataset v1
|
325 |
-
# Done! Thanks to the awesome DIBT community we've surpassed 10K rated prompts. Open Dataset coming soon!
|
326 |
-
# """
|
327 |
-
# )
|
328 |
-
|
329 |
gr.Markdown(
|
330 |
f"""
|
331 |
-
## π
|
332 |
-
|
333 |
"""
|
334 |
)
|
335 |
with gr.Row():
|
@@ -360,8 +344,8 @@ def main() -> None:
|
|
360 |
|
361 |
gr.Markdown(
|
362 |
"""
|
363 |
-
## πΎ
|
364 |
-
The
|
365 |
"""
|
366 |
)
|
367 |
|
@@ -373,7 +357,7 @@ def main() -> None:
|
|
373 |
)
|
374 |
|
375 |
top5_df_plot = gr.Dataframe(
|
376 |
-
headers=["
|
377 |
datatype=[
|
378 |
"markdown",
|
379 |
"number",
|
|
|
84 |
source = pd.DataFrame(
|
85 |
{
|
86 |
"values": [annotated_records, pending_records],
|
87 |
+
"category": ["Vertaald", "Nog te gaan"],
|
88 |
"colors": ["#4CAF50", "#757575"], # Green for Completed, Grey for Remaining
|
89 |
}
|
90 |
)
|
|
|
123 |
source = pd.DataFrame(
|
124 |
{
|
125 |
"values": [annotated_records, pending_records],
|
126 |
+
"category": ["Vertaald", "Nog te gaan"],
|
127 |
"colors": ["#4CAF50", "#757575"], # Green for Completed, Grey for Remaining
|
128 |
}
|
129 |
)
|
|
|
154 |
|
155 |
pending_records = int(os.getenv("TARGET_RECORDS")) - len(target_dataset)
|
156 |
# Assuming you have a DataFrame with user data, create a sample DataFrame
|
157 |
+
data = pd.DataFrame({"Category": ["Nog te gaan"], "Value": [pending_records]})
|
158 |
|
159 |
# Create Altair chart
|
160 |
chart = (
|
161 |
alt.Chart(data)
|
162 |
.mark_text(fontSize=100, align="center", baseline="middle", color="steelblue")
|
163 |
.encode(text="Value:N")
|
164 |
+
.properties(title="Nog te gaan", width=250, height=200)
|
165 |
)
|
166 |
|
167 |
return chart
|
|
|
177 |
total = len(target_dataset)
|
178 |
|
179 |
# Assuming you have a DataFrame with user data, create a sample DataFrame
|
180 |
+
data = pd.DataFrame({"Category": ["Totaal vertaald"], "Value": [total]})
|
181 |
|
182 |
# Create Altair chart
|
183 |
chart = (
|
184 |
alt.Chart(data)
|
185 |
.mark_text(fontSize=100, align="center", baseline="middle", color="steelblue")
|
186 |
.encode(text="Value:N")
|
187 |
+
.properties(title="Totaal vertaald", width=250, height=200)
|
188 |
)
|
189 |
|
190 |
return chart
|
|
|
203 |
|
204 |
# Assuming you have a DataFrame with user data, create a sample DataFrame
|
205 |
data = pd.DataFrame(
|
206 |
+
{"Category": ["Aantal vertalers"], "Value": [total_annotators]}
|
207 |
)
|
208 |
|
209 |
# Create Altair chart
|
|
|
211 |
alt.Chart(data)
|
212 |
.mark_text(fontSize=100, align="center", baseline="middle", color="steelblue")
|
213 |
.encode(text="Value:N")
|
214 |
+
.properties(title="Aantal vertalers", width=250, height=200)
|
215 |
)
|
216 |
|
217 |
return chart
|
|
|
234 |
"""
|
235 |
|
236 |
dataframe = pd.DataFrame(
|
237 |
+
user_ids_annotations.items(), columns=["Username", "Aantal vertalingen"]
|
238 |
)
|
239 |
dataframe["Name"] = dataframe["Name"].apply(render_hub_user_link)
|
240 |
dataframe = dataframe.sort_values(by="Submitted Responses", ascending=False)
|
|
|
296 |
with gr.Blocks(css=css) as demo:
|
297 |
gr.Markdown(
|
298 |
"""
|
299 |
+
# π³π±π§πͺ Nederlands - Multilingual Prompt Evaluation Project
|
300 |
|
301 |
+
Hugging Face en @argilla crowdsourcen het [Multilingual Prompt Evaluation Project](https://github.com/huggingface/data-is-better-together/tree/main/prompt_translation): een open meertalige benchmark voor de evaluatie van taalmodellen, en dus ook voor het Nederlands.
|
302 |
+
|
303 |
+
En zoals altijd: daarvoor is data nodig! Vorige week hebben ze met de community al de beste 500 prompts geselecteerd die de benchmark gaan vormen. In het Engels, uiteraard.
|
304 |
+
|
305 |
+
**Daarom is nu jouw hulp nodig**: als we samen alle 500 prompts vertalen kunnen we Nederlands toegevoegd krijgen aan het leaderboard.
|
306 |
+
|
307 |
+
Meedoen is simpel. Ga naar [Annotatie-Space](https://dibt-dutch-prompt-translation-for-dutch.hf.space/), log in of maak een Hugging Face account, en je kunt meteen aan de slag.
|
308 |
+
|
309 |
+
Alvast bedankt! Oh, je krijgt ook een steuntje in de rug: GPT4 heeft alvast een vertaalsuggestie voor je klaargezet.
|
310 |
"""
|
311 |
)
|
312 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
gr.Markdown(
|
314 |
f"""
|
315 |
+
## π Voortgang
|
316 |
+
Dit is wat de community tot nu toe heeft bereikt!
|
317 |
"""
|
318 |
)
|
319 |
with gr.Row():
|
|
|
344 |
|
345 |
gr.Markdown(
|
346 |
"""
|
347 |
+
## πΎ Scoreboard
|
348 |
+
The totaal aantal vertalers en de vertalers met de meeste bijdragen:
|
349 |
"""
|
350 |
)
|
351 |
|
|
|
357 |
)
|
358 |
|
359 |
top5_df_plot = gr.Dataframe(
|
360 |
+
headers=["Username", "Aantal vertalingen"],
|
361 |
datatype=[
|
362 |
"markdown",
|
363 |
"number",
|