|
--- |
|
dataset_info: |
|
features: |
|
- name: ml |
|
dtype: string |
|
- name: en |
|
dtype: string |
|
splits: |
|
- name: train |
|
num_bytes: 1133730838 |
|
num_examples: 27787044 |
|
download_size: 520146321 |
|
dataset_size: 1133730838 |
|
configs: |
|
- config_name: default |
|
data_files: |
|
- split: train |
|
path: data/train-* |
|
license: cc |
|
language: |
|
- ml |
|
- en |
|
size_categories: |
|
- 1M<n<10M |
|
--- |
|
|
|
## English Malayalam Names |
|
|
|
### Dataset Description |
|
|
|
This dataset has 27787044 person names both in English and Malayalam. The source for this dataset is various election roles published by Government. |
|
|
|
Derived From: https://huggingface.co/datasets/santhosh/english-malayalam-names |
|
|
|
- **Curated by:** Bajiyo Baiju |
|
- **License:** CC-BY-SA-4.0 |
|
|
|
|
|
## Uses |
|
|
|
- English <-> Malayalam name transliteration tasks |
|
- Named entity recognition |
|
- Person name recognition |
|
|
|
## Dataset Curation |
|
|
|
``` |
|
# Assuming 'ml' is the column containing Malayalam names and 'en' is the English names column in your dataset |
|
from datasets import load_dataset |
|
|
|
data = load_dataset("santhosh/english-malayalam-names") |
|
|
|
malayalam_names = data['ml'].tolist() |
|
english_names = data['en'].tolist() |
|
|
|
# Define a function to check if a name contains mostly English characters |
|
def is_english_name(name): |
|
english_char_count = sum(c.isalpha() and c.isascii() for c in name) |
|
return english_char_count / len(name) > 0.5 # Adjust the threshold as needed |
|
|
|
# Find and count names that are likely to be English in 'ml' column |
|
english_names_ml_column = [name for name in malayalam_names if is_english_name(name)] |
|
count_english_names_ml_column = len(english_names_ml_column) |
|
|
|
# Find Malayalam words in the 'en' column |
|
malayalam_words_en_column = [word for word in english_names if not any(c.isascii() for c in word)] |
|
count_malayalam_words_en_column = len(malayalam_words_en_column) |
|
|
|
# Print the results |
|
print("Count of English-like Names in Malayalam Names Column:", count_english_names_ml_column) |
|
#print("English-like Names in Malayalam Names Column:", english_names_ml_column) |
|
|
|
print("\nCount of Malayalam Words in English Names Column:", count_malayalam_words_en_column) |
|
print("Malayalam Words in English Names Column:", malayalam_words_en_column) |
|
|
|
# Identify English-like names and remove them |
|
english_names_mask = data['ml'].isin(english_names_ml_column) |
|
data = data[~english_names_mask] |
|
|
|
# Identify Malayalam words and remove them |
|
malayalam_words_mask = data['en'].isin(malayalam_words_en_column) |
|
data = data[~malayalam_words_mask] |
|
|
|
# Remove empty rows |
|
data = data[(data['ml'] != '') & (data['en'] != '')] |
|
|
|
# Verify the changes |
|
print("Updated 'ml' column after removing English-like Names:") |
|
print(data['ml']) |
|
|
|
print("\nUpdated 'en' column after removing Malayalam Words:") |
|
print(data['en']) |
|
``` |
|
|