Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html> <h"... is not valid JSON

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

YAML Metadata Warning:The task_categories "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other

Wikidata Labels

Large parallel corpus for machine translation

  • Entity label data extracted from Wikidata (2022-01-03), filtered for item entities only
  • Only download the languages you need with datasets>=2.14.0
  • Similar dataset: https://huggingface.co/datasets/wmt/wikititles (18 Wikipedia titles pairs instead of all Wikidata entities)

Dataset Details

Dataset Sources

Uses

You can generate parallel text examples from this dataset like below:

from datasets import load_dataset
import pandas as pd

def parallel_labels(lang_codes: list, how="inner", repo_id="rayliuca/wikidata_entity_label", merge_config={}, datasets_config={}) -> pd.DataFrame:
    out_df = None
    for lc in lang_codes:
        dataset = load_dataset(repo_id, lc, **datasets_config)
        dataset_df = dataset['label'].to_pandas().rename(columns={"label":lc}).drop(columns=['lastrevid'])
        if out_df is None:
            out_df = dataset_df
        else:
            out_df = out_df.merge(
                    dataset_df,
                    on='wikidata_id',
                    how=how,
                    **merge_config
                )
    return out_df

# Note: the "en" subset is >4GB
parallel_labels(['en', 'fr', 'ja', 'zh']).head()

Output

wikidata_id en fr ja zh
0 Q109739412 SARS-CoV-2 Omicron variant variant Omicron du SARS-CoV-2 SARSコロナウイルス2-オミクロン株 嚴重急性呼吸道症候群冠狀病毒2型Omicron變異株
1 Q108460606 Ulughbegsaurus Ulughbegsaurus ウルグベグサウルス 兀魯伯龍屬
2 Q108556886 AUKUS AUKUS AUKUS AUKUS
3 Q106496152 Claude Joseph Claude Joseph クロード・ジョゼフ 克洛德·约瑟夫
4 Q105519361 The World's Finest Assassin Gets Reincarnated in a Different World as an Aristocrat The World's Finest Assassin Gets Reincarnated in Another World as an Aristocrat 世界最高の暗殺者、異世界貴族に転生する 世界頂尖的暗殺者轉生為異世界貴族

Note: this example table above shows a quirk(?) of the Wiki data. The French Wikipedia page The World's Finest Assassin Gets Reincarnated in Another World as an Aristocrat uses English for its title. While this could be disadvantageous for direct translation training, it also provides insights into how native speakers might call this entity instead of the literal translation on the Wiki page as well

Dataset Structure

Each language has its own subset (aka config), which means you only have to download the languages you need with datasets>=2.14.0

Each subset has these fields:

  • wikidata_id
  • lastrevid
  • label

Dataset Creation

Data Collection and Processing

  • Filtered for item entities only
  • Ignored the descriptions as those texts are not very parallel

Bias, Risks, and Limitations

  • Might be slightly outdated (2022)
  • Popular languages have more entries
  • Labels are not guaranteed to be literal translations (see examples above)
Downloads last month
4,252