Spaces:
Running
Running
Upload from GitHub Actions: Merge pull request #6 from datenlabor-bmz/jn-dev
Browse files- evals/countries.py +9 -4
evals/countries.py
CHANGED
|
@@ -30,10 +30,15 @@ def make_country_table(language_table):
|
|
| 30 |
)
|
| 31 |
for country, languages in countries.items():
|
| 32 |
speaker_pop = sum(entry["population"] for entry in languages)
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
countries[country] = {
|
| 38 |
"score": score,
|
| 39 |
"languages": languages,
|
|
|
|
| 30 |
)
|
| 31 |
for country, languages in countries.items():
|
| 32 |
speaker_pop = sum(entry["population"] for entry in languages)
|
| 33 |
+
|
| 34 |
+
if speaker_pop < 1000: # 🎯 Grey out low-population countries
|
| 35 |
+
score = None # This will make them appear grey on the map
|
| 36 |
+
else:
|
| 37 |
+
score = (
|
| 38 |
+
sum(entry["score"] * entry["population"] for entry in languages)
|
| 39 |
+
/ speaker_pop
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
countries[country] = {
|
| 43 |
"score": score,
|
| 44 |
"languages": languages,
|