Datasets:
kavyamanohar
commited on
Commit
•
afbf725
1
Parent(s):
c6dcf22
Update README.md
Browse files
README.md
CHANGED
@@ -16,4 +16,78 @@ configs:
|
|
16 |
data_files:
|
17 |
- split: train
|
18 |
path: data/train-*
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
data_files:
|
17 |
- split: train
|
18 |
path: data/train-*
|
19 |
+
license: cc
|
20 |
+
language:
|
21 |
+
- ml
|
22 |
+
- en
|
23 |
+
size_categories:
|
24 |
+
- 1M<n<10M
|
25 |
---
|
26 |
+
|
27 |
+
## English Malayalam Names
|
28 |
+
|
29 |
+
### Dataset Description
|
30 |
+
|
31 |
+
This dataset has 27787044 person names both in English and Malayalam. The source for this dataset is various election roles published by Government.
|
32 |
+
|
33 |
+
Derived From: https://huggingface.co/datasets/santhosh/english-malayalam-names
|
34 |
+
|
35 |
+
- **Curated by:** Bajiyo Baiju
|
36 |
+
- **License:** CC-BY-SA-4.0
|
37 |
+
|
38 |
+
|
39 |
+
## Uses
|
40 |
+
|
41 |
+
- English <-> Malayalam name transliteration tasks
|
42 |
+
- Named entity recognition
|
43 |
+
- Person name recognition
|
44 |
+
|
45 |
+
## Dataset Curation
|
46 |
+
|
47 |
+
```
|
48 |
+
# Assuming 'ml' is the column containing Malayalam names and 'en' is the English names column in your dataset
|
49 |
+
from datasets import load_dataset
|
50 |
+
|
51 |
+
data = load_dataset("santhosh/english-malayalam-names")
|
52 |
+
|
53 |
+
malayalam_names = data['ml'].tolist()
|
54 |
+
english_names = data['en'].tolist()
|
55 |
+
|
56 |
+
# Define a function to check if a name contains mostly English characters
|
57 |
+
def is_english_name(name):
|
58 |
+
english_char_count = sum(c.isalpha() and c.isascii() for c in name)
|
59 |
+
return english_char_count / len(name) > 0.5 # Adjust the threshold as needed
|
60 |
+
|
61 |
+
# Find and count names that are likely to be English in 'ml' column
|
62 |
+
english_names_ml_column = [name for name in malayalam_names if is_english_name(name)]
|
63 |
+
count_english_names_ml_column = len(english_names_ml_column)
|
64 |
+
|
65 |
+
# Find Malayalam words in the 'en' column
|
66 |
+
malayalam_words_en_column = [word for word in english_names if not any(c.isascii() for c in word)]
|
67 |
+
count_malayalam_words_en_column = len(malayalam_words_en_column)
|
68 |
+
|
69 |
+
# Print the results
|
70 |
+
print("Count of English-like Names in Malayalam Names Column:", count_english_names_ml_column)
|
71 |
+
#print("English-like Names in Malayalam Names Column:", english_names_ml_column)
|
72 |
+
|
73 |
+
print("\nCount of Malayalam Words in English Names Column:", count_malayalam_words_en_column)
|
74 |
+
print("Malayalam Words in English Names Column:", malayalam_words_en_column)
|
75 |
+
|
76 |
+
# Identify English-like names and remove them
|
77 |
+
english_names_mask = data['ml'].isin(english_names_ml_column)
|
78 |
+
data = data[~english_names_mask]
|
79 |
+
|
80 |
+
# Identify Malayalam words and remove them
|
81 |
+
malayalam_words_mask = data['en'].isin(malayalam_words_en_column)
|
82 |
+
data = data[~malayalam_words_mask]
|
83 |
+
|
84 |
+
# Remove empty rows
|
85 |
+
data = data[(data['ml'] != '') & (data['en'] != '')]
|
86 |
+
|
87 |
+
# Verify the changes
|
88 |
+
print("Updated 'ml' column after removing English-like Names:")
|
89 |
+
print(data['ml'])
|
90 |
+
|
91 |
+
print("\nUpdated 'en' column after removing Malayalam Words:")
|
92 |
+
print(data['en'])
|
93 |
+
```
|