Run this model with HF Jobs
Run CAMeL-Lab/bert-base-arabic-camelbert-da on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/CAMeL-Lab/bert-base-arabic-camelbert-da. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/CAMeL-Lab/bert-base-arabic-camelbert-da on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use CAMeL-Lab/bert-base-arabic-camelbert-da with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CAMeL-Lab/bert-base-arabic-camelbert-da with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="CAMeL-Lab/bert-base-arabic-camelbert-da")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("CAMeL-Lab/bert-base-arabic-camelbert-da") model = AutoModelForMaskedLM.from_pretrained("CAMeL-Lab/bert-base-arabic-camelbert-da", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Go Inoue commited on
Commit ·
fd39d7b
1
Parent(s): 89437c2
Fix typo
Browse files2 unmodified lines345667898 unmodified lines181920212122232412 unmodified lines373839404140414243444545464748494849505152535253545556575657585960606162631 unmodified line65666768686970713 unmodified lines7576777878798081828384858687888984858687882 unmodified lines- arlicense: apache-2.0widget: - text: "الهدف من الحياة هو [MASK] ." - text: "\UTF{0627}\UTF{0644}\UTF{0647}\UTF{062F}\UTF{0641} \UTF{0645}\UTF{0646} \UTF{0627}\UTF{0644}\UTF{062D}\UTF{064A}\UTF{0627}\UTF{0629} \UTF{0647}\UTF{0648} [MASK] ."---
# bert-base-camelbert-msa8 unmodified lines|-|-|:-:|-:|-:|||`bert-base-camelbert-mix`|CA,DA,MSA|167GB|17.3B|||`bert-base-camelbert-ca`|CA|6GB|847M||✔|`bert-base-camelbert-da`|DA|54GB|5.8B||\UTF{2714}|`bert-base-camelbert-da`|DA|54GB|5.8B|||`bert-base-camelbert-msa`|MSA|107GB|12.6B|||`bert-base-camelbert-msa-half`|MSA|53GB|6.3B|||`bert-base-camelbert-msa-quarter`|MSA|27GB|3.1B|12 unmodified lines```python>>> from transformers import pipeline>>> unmasker = pipeline('fill-mask', model='CAMeL-Lab/bert-base-camelbert-da')>>> unmasker("الهدف من الحياة هو [MASK] .")[{'sequence': '[CLS] الهدف من الحياة هو.. [SEP]',>>> unmasker("\UTF{0627}\UTF{0644}\UTF{0647}\UTF{062F}\UTF{0641} \UTF{0645}\UTF{0646} \UTF{0627}\UTF{0644}\UTF{062D}\UTF{064A}\UTF{0627}\UTF{0629} \UTF{0647}\UTF{0648} [MASK] .")[{'sequence': '[CLS] \UTF{0627}\UTF{0644}\UTF{0647}\UTF{062F}\UTF{0641} \UTF{0645}\UTF{0646} \UTF{0627}\UTF{0644}\UTF{062D}\UTF{064A}\UTF{0627}\UTF{0629} \UTF{0647}\UTF{0648}.. [SEP]', 'score': 0.062508225440979, 'token': 18, 'token_str': '.'}, {'sequence': '[CLS] الهدف من الحياة هو الموت. [SEP]', {'sequence': '[CLS] \UTF{0627}\UTF{0644}\UTF{0647}\UTF{062F}\UTF{0641} \UTF{0645}\UTF{0646} \UTF{0627}\UTF{0644}\UTF{062D}\UTF{064A}\UTF{0627}\UTF{0629} \UTF{0647}\UTF{0648} \UTF{0627}\UTF{0644}\UTF{0645}\UTF{0648}\UTF{062A}. [SEP]', 'score': 0.033172328025102615, 'token': 4295, 'token_str': 'الموت'}, {'sequence': '[CLS] الهدف من الحياة هو الحياة. [SEP]', 'token_str': '\UTF{0627}\UTF{0644}\UTF{0645}\UTF{0648}\UTF{062A}'}, {'sequence': '[CLS] \UTF{0627}\UTF{0644}\UTF{0647}\UTF{062F}\UTF{0641} \UTF{0645}\UTF{0646} \UTF{0627}\UTF{0644}\UTF{062D}\UTF{064A}\UTF{0627}\UTF{0629} \UTF{0647}\UTF{0648} \UTF{0627}\UTF{0644}\UTF{062D}\UTF{064A}\UTF{0627}\UTF{0629}. [SEP]', 'score': 0.029575437307357788, 'token': 3696, 'token_str': 'الحياة'}, {'sequence': '[CLS] الهدف من الحياة هو الرحيل. [SEP]', 'token_str': '\UTF{0627}\UTF{0644}\UTF{062D}\UTF{064A}\UTF{0627}\UTF{0629}'}, {'sequence': '[CLS] \UTF{0627}\UTF{0644}\UTF{0647}\UTF{062F}\UTF{0641} \UTF{0645}\UTF{0646} \UTF{0627}\UTF{0644}\UTF{062D}\UTF{064A}\UTF{0627}\UTF{0629} \UTF{0647}\UTF{0648} \UTF{0627}\UTF{0644}\UTF{0631}\UTF{062D}\UTF{064A}\UTF{0644}. [SEP]', 'score': 0.02724040113389492, 'token': 11449, 'token_str': 'الرحيل'}, {'sequence': '[CLS] الهدف من الحياة هو الحب. [SEP]', 'token_str': '\UTF{0627}\UTF{0644}\UTF{0631}\UTF{062D}\UTF{064A}\UTF{0644}'}, {'sequence': '[CLS] \UTF{0627}\UTF{0644}\UTF{0647}\UTF{062F}\UTF{0641} \UTF{0645}\UTF{0646} \UTF{0627}\UTF{0644}\UTF{062D}\UTF{064A}\UTF{0627}\UTF{0629} \UTF{0647}\UTF{0648} \UTF{0627}\UTF{0644}\UTF{062D}\UTF{0628}. [SEP]', 'score': 0.01564178802073002, 'token': 3088, 'token_str': 'الحب'}] 'token_str': '\UTF{0627}\UTF{0644}\UTF{062D}\UTF{0628}'}]```
Here is how to use this model to get the features of a given text in PyTorch:1 unmodified linefrom transformers import AutoTokenizer, AutoModeltokenizer = AutoTokenizer.from_pretrained('CAMeL-Lab/bert-base-camelbert-da')model = AutoModel.from_pretrained('CAMeL-Lab/bert-base-camelbert-da')text = "مرحبا يا عالم."text = "\UTF{0645}\UTF{0631}\UTF{062D}\UTF{0628}\UTF{0627} \UTF{064A}\UTF{0627} \UTF{0639}\UTF{0627}\UTF{0644}\UTF{0645}."encoded_input = tokenizer(text, return_tensors='pt')output = model(**encoded_input)```3 unmodified linesfrom transformers import AutoTokenizer, TFAutoModeltokenizer = AutoTokenizer.from_pretrained('CAMeL-Lab/bert-base-camelbert-da')model = TFAutoModel.from_pretrained('CAMeL-Lab/bert-base-camelbert-da')text = "مرحبا يا عالم."text = "\UTF{0645}\UTF{0631}\UTF{062D}\UTF{0628}\UTF{0627} \UTF{064A}\UTF{0627} \UTF{0639}\UTF{0627}\UTF{0644}\UTF{0645}."encoded_input = tokenizer(text, return_tensors='tf')output = model(encoded_input)```
## Training data- MSA - [The Arabic Gigaword Fifth Edition](https://catalog.ldc.upenn.edu/LDC2011T11) - [Abu El-Khair Corpus](http://www.abuelkhair.net/index.php/en/arabic/abu-el-khair-corpus) - [OSIAN corpus](https://vlo.clarin.eu/search;jsessionid=31066390B2C9E8C6304845BA79869AC1?1&q=osian) - [Arabic Wikipedia](https://archive.org/details/arwiki-20190201) - The unshuffled version of the Arabic [OSCAR corpus](https://oscar-corpus.com/)- DA - A collection of dialectal Arabic data described in our paper.
## Training procedureWe use [the original implementation](https://github.com/google-research/bert) released by Google for pre-training.README.md+16-20