Datasets:
metadata
language:
- ar
pretty_name: TypePrediction
task_categories:
- token-classification
tags:
- named-entity-recognition
- arabic
- wojood
- entity-typing
size_categories:
- 100K<n<1M
TypePrediction
Unified mention-level type prediction data built from all available local Wojood NER datasets except WojoodRelations.
Main file
type_predictor_data.jsonltype_predictor_train.jsonltype_predictor_val.jsonltype_predictor_test.jsonlsummary.jsonsplit_summary.jsonbuild_type_prediction_dataset.pypush_to_hf.pysplit_data.pyartifacts/ambiguous_span_type_conflicts.jsonlartifacts/split_assignments.jsonl
Each row contains:
{
"id": "tp_000001",
"entity": "النص",
"type": "ORG",
"sentence": "الجملة الكاملة",
"start_token": 0,
"end_token": 1,
"start_char": 0,
"end_char": 10,
"raw_types": ["ORG", "NONGOV"],
"sources": [
{"dataset": "WojoodFine", "split": "train"},
{"dataset": "Wojood1_1_nested", "split": "train"}
]
}
Stored row examples
Simple flat/coarse example:
{
"id": "tp_000001",
"entity": "عبد الحميد عبد العاطي",
"type": "PERS",
"sentence": "! ! ! تم النشر قبل بواسطة عبد الحميد عبد العاطي ازهقنا .",
"start_token": 7,
"end_token": 10,
"start_char": 26,
"end_char": 47,
"raw_types": ["PERS"],
"sources": [{"dataset": "WojoodFine", "split": "train"}]
}
Example where a fine label is mapped to a coarse label:
{
"id": "tp_001001",
"entity": "للعراقيين",
"type": "NORP",
"sentence": ", أثارت محاكمات 11 مشتبها بهم فرنسيين في العراق في مايو / أيار هذه المخاوف ، ليس فقط للمشتبه بهم الأجانب بل للعراقيين أيضا .",
"start_token": 22,
"end_token": 22,
"start_char": 108,
"end_char": 117,
"raw_types": ["NORP"],
"sources": [{"dataset": "WojoodFine", "split": "train"}]
}
Example merged across multiple source datasets:
{
"id": "tp_050001",
"entity": "مصر",
"type": "GPE",
"sentence": "بعدما أطاح به آية الله الخميني وبنظامه ، حيث توجه بداية إلى مصر قبل أن يستقر به الأمر في المغرب ، ,",
"start_token": 12,
"end_token": 12,
"start_char": 60,
"end_char": 63,
"raw_types": ["GPE", "COUNTRY"],
"sources": [
{"dataset": "Wojood1_1_flat", "split": "test"},
{"dataset": "Wojood1_1_nested", "split": "test"},
{"dataset": "WojoodFine-Flat", "split": "split20"}
]
}
Construction
- Parse all sentence-separated CoNLL-style files from:
Wojood1_1_flatWojood1_1_nestedWojoodFineWojoodFine-Flat
- Extract every entity span, including nested spans when multiple BIO tags are present on the same token sequence.
- Map fine labels to coarse labels using
wojood_ontology.json. - Reconstruct full sentence text and both token and character spans.
- Deduplicate by
(sentence, entity, type, start_token, end_token)and merge provenance. - Remove exact span/type conflicts from the main file:
- conflict key:
(sentence, entity, start_token, end_token, start_char, end_char) - if the same exact span has more than one coarse type, all candidate rows for that span are written to
artifacts/ambiguous_span_type_conflicts.jsonl - the main
type_predictor_data.jsonlkeeps only unambiguous rows
- conflict key:
- Assign deterministic ids in final sorted order:
tp_000001,tp_000002, ...
Parsing details and edge cases
Wojood1_1_flatuses simple space-separatedtoken tagrows.Wojood1_1_nesteduses space-separated rows with multiple BIO tags on the same token when nested annotations exist.WojoodFineandWojoodFine-Flatuse tab-separated rows.- Some
WojoodFinerows place multiple tags inside a single tab field, for example:نبيه\tI-OCC B-PERS\t\t\tThe builder normalizes this by splitting tag cells on internal whitespace.
- Some fine labels appear with alias spellings that differ from the ontology ids, for example:
GPE-ORG->GPE_ORGCluster->CLUSTERPath->PATHThe builder canonicalizes these before mapping to coarse parents.
- Sentence boundaries are read from blank lines in the CoNLL files.
- Character spans are reconstructed after joining sentence tokens with single spaces.
- The main file is single-label by construction. Ambiguous multi-type spans are excluded rather than guessed.
Summary
- total rows:
125996 - unique sentences:
33933 - raw extracted mentions before dedupe:
408035 - rows merged by dedupe:
275272 - ambiguous span groups excluded:
3383 - candidate rows excluded by ambiguity filtering:
6767
Source breakdown
Wojood1_1_flat/test: 14573 mentions from 6606 sentencesWojood1_1_flat/train: 49959 mentions from 23125 sentencesWojood1_1_flat/val: 7143 mentions from 3304 sentencesWojood1_1_nested/test: 18045 mentions from 6606 sentencesWojood1_1_nested/train: 62377 mentions from 23125 sentencesWojood1_1_nested/val: 8944 mentions from 3304 sentencesWojoodFine/test: 27848 mentions from 5748 sentencesWojoodFine/train: 96188 mentions from 19484 sentencesWojoodFine/val: 13800 mentions from 2828 sentencesWojoodFine-Flat/split10: 10859 mentions from 3304 sentencesWojoodFine-Flat/split20: 22208 mentions from 6606 sentencesWojoodFine-Flat/split70: 76091 mentions from 23125 sentences
Top coarse types
GPE: 26902ORG: 26593DATE: 19762PERS: 10712NORP: 10217ORDINAL: 7807OCC: 7696EVENT: 3769CARDINAL: 3724LOC: 2388WEBSITE: 1478FAC: 1296LAW: 904TIME: 871MONEY: 420CURR: 411LANGUAGE: 332PERCENT: 312PRODUCT: 190QUANTITY: 106
Validation performed
- verified that all four non-relation Wojood sources were included
- verified nested extraction is enabled when multiple tags occur on one token
- verified fine-to-coarse mapping uses the repo's
wojood_ontology.json - verified
sentence[start_char:end_char] == entityacross the built file - verified deduped rows merge provenance rather than silently dropping it
- verified no exact span in the main file has more than one coarse type
- verified ids are unique and deterministic
Split files
The repo also includes a mention-level stratified split built from type_predictor_data.jsonl:
type_predictor_train.jsonltype_predictor_val.jsonltype_predictor_test.jsonlsplit_summary.jsonartifacts/split_assignments.jsonlsplit_data.py
Split policy:
- Start from the clean
type_predictor_data.jsonl. - Perform a stratified
80/20split by thetypecolumn withrandom_state = 42. - Split the holdout pool again, stratified by
type, into equal halves. - Keep sentence overlap allowed across splits.
- Preserve all original fields.
- Add
evaluation_categoryonly to validation and test rows:unseen_sentenceseen_sentence_new_entity
Current split sizes:
- train:
100,796 - validation:
12,600 - test:
12,600
Current evaluation-category counts:
- validation
seen_sentence_new_entity:11,661 - validation
unseen_sentence:939 - test
seen_sentence_new_entity:11,606 - test
unseen_sentence:994