Downloads · 30 days
0
U4RASD/DRU-RE-EntityPair-TwoHead-AraBERTv02-Large
DRU-RE-EntityPair-TwoHead-AraBERTv02-Large is a machine learning model from U4RASD. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This package trains and releases a single Arabic relation extraction model in the EntityPair-TwoHead family. The only relation encoder is aubmindlab/bert-large-arabertv02.
Downloads · 30 days
0
Access
Public
Updated Jul 26, 2026
Parameters
375M
7.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.5 GB · 48%
How the weights are stored.
F32375M · 100%
From the Hugging Face model README
This package trains and releases a single Arabic relation extraction model in the EntityPair-TwoHead family. The only relation encoder is aubmindlab/bert-large-arabertv02.
The pair representation is:
[CLS ; subject marker ; object marker ; |subject-object| ; subject*object ; directional type vector]
The directional type vector is 42-dimensional: 21 subject-type one-hot values followed by 21 object-type one-hot values. For AraBERTv02-large the verified encoder hidden size is 1024, so the pair feature size is 5 * 1024 + 42 = 5162.
The classifier has a shared MLP:
It then predicts relation existence with a 2-way head and positive relation type with a 40-way head. The positive head loss is applied only to rows whose gold label is not no_relation.
cd /root/workspace/DRU_RE_EntityPair_TwoHead_AraBERTv02_Large
bash setup_env.sh
bash run_smoke_tests.sh
The workspace must contain /root/workspace/.env with nonempty HF_TOKENONE and HF_TOKENTWO. Token values must never be printed or uploaded.
bash run_train.sh
bash run_resume.sh
Best checkpoint selection uses validation positive micro-F1 excluding no_relation with existence threshold 0.5. The final optimizer step is saved separately as the last checkpoint.
bash run_evaluate_best.sh
bash run_evaluate_last.sh
Evaluation artifacts are written under outputs/evaluation/best/ and outputs/evaluation/last/.
Completed run summary:
no_relation = 0.533958, all-label accuracy = 0.622407.no_relation = 0.507371, all-label accuracy = 0.611144.bash run_test_all.sh
bash validate_all_submissions.sh
The local /root/workspace/test.jsonl is read in place, row order is preserved, and it is not uploaded. Candidate generation finds every exact occurrence of both entity strings, applies a conservative Arabic-normalized fallback only when exact matching fails, runs U4RASD/TypePredictor once per unique occurrence, applies ontology masking, and writes a validated submission ZIP for each checkpoint/strategy pair.
Strategies: max_joint, top_existence, max_positive, majority_vote, soft_pool, top_confidence, legacy_majority_sum, plus preserved legacy aliases any_positive_max_q and soft_joint_pool.
python -m dru_re_arabert_large.package_release
bash push_release.sh
The Hugging Face repository is U4RASD/DRU-RE-EntityPair-TwoHead-AraBERTv02-Large. It is created private by default.
Known limitations: full determinism is not guaranteed on CUDA; span-free inference cannot fabricate spans when an entity string is absent; strongly negative candidates can dominate top_confidence by design.