beshiribrahim commited on
Commit
f1b108c
·
verified ·
1 Parent(s): 7f563a2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -47
README.md CHANGED
@@ -5,19 +5,26 @@ language:
5
  task_categories:
6
  - translation
7
  ---
8
- put this in nice html format
9
 
 
10
 
 
 
 
 
 
 
 
11
  from datasets import load_dataset
12
  import pandas as pd
13
 
14
  # Load dataset from Hugging Face Hub
15
  dataset = load_dataset(
16
-     "BeitTigreAI/tigre-data-parallel-multilingual",
17
-     data_files={
18
-         "train": "train.parquet",
19
-         "validation": "validation.parquet"
20
-     }
21
  )
22
 
23
  # Print dataset info
@@ -28,44 +35,13 @@ print(dataset)
28
  print("\n🔍 Number of samples per target language:")
29
 
30
  for split in ["train", "validation"]:
31
-     print(f"\n➡️  {split.title()} Split:")
32
-     df = dataset[split].to_pandas()
33
-     
34
-     # Count by tgt_lang
35
-     lang_counts = df["tgt_lang"].value_counts().to_frame().reset_index()
36
-     lang_counts.columns = ["tgt_lang", "count"]
37
-     lang_counts["percentage"] = (lang_counts["count"] / lang_counts["count"].sum() * 100).round(2)
38
-     
39
-     # Print as table
40
-     print(lang_counts.to_string(index=False))
41
-
42
-
43
-
44
-
45
- 📊 Dataset Info:
46
- DatasetDict({
47
-     train: Dataset({
48
-         features: ['id', 'src', 'tgt', 'src_lang', 'tgt_lang'],
49
-         num_rows: 283180
50
-     })
51
-     validation: Dataset({
52
-         features: ['id', 'src', 'tgt', 'src_lang', 'tgt_lang'],
53
-         num_rows: 6964
54
-     })
55
- })
56
-
57
- 🔍 Number of samples per target language:
58
-
59
- ➡️  Train Split:
60
- tgt_lang  count  percentage
61
- eng_Latn 132323       46.73
62
- deu_Latn  67335       23.78
63
- ara_Arab  43204       15.26
64
- swe_Latn  26762        9.45
65
- nob_Latn   7548        2.67
66
- nno_Latn   5530        1.95
67
- tir_Ethi    478        0.17
68
-
69
- ➡️  Validation Split:
70
- tgt_lang  count  percentage
71
- eng_Latn   6964       100.0
 
5
  task_categories:
6
  - translation
7
  ---
 
8
 
9
+ # Dataset Analysis Report
10
 
11
+ This report presents an analysis of the 'tigre-data-parallel-multilingual' dataset from the Hugging Face Hub, including dataset information and sample distribution by target language.
12
+
13
+ ---
14
+
15
+ ### Python Script
16
+
17
+ ```python
18
  from datasets import load_dataset
19
  import pandas as pd
20
 
21
  # Load dataset from Hugging Face Hub
22
  dataset = load_dataset(
23
+ "BeitTigreAI/tigre-data-parallel-multilingual",
24
+ data_files={
25
+ "train": "train.parquet",
26
+ "validation": "validation.parquet"
27
+ }
28
  )
29
 
30
  # Print dataset info
 
35
  print("\n🔍 Number of samples per target language:")
36
 
37
  for split in ["train", "validation"]:
38
+ print(f"\n➡️ {split.title()} Split:")
39
+ df = dataset[split].to_pandas()
40
+
41
+ # Count by tgt_lang
42
+ lang_counts = df["tgt_lang"].value_counts().to_frame().reset_index()
43
+ lang_counts.columns = ["tgt_lang", "count"]
44
+ lang_counts["percentage"] = (lang_counts["count"] / lang_counts["count"].sum() * 100).round(2)
45
+
46
+ # Print as table
47
+ print(lang_counts.to_string(index=False))