Mhammad Ibrahim
commited on
Commit
·
7fca23a
1
Parent(s):
490f91b
Add model card
Browse files
README.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
| 1 |
# My Dummy Model
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# My Dummy Model
|
| 2 |
|
| 3 |
+
---
|
| 4 |
+
language: fr
|
| 5 |
+
license: apache-2.0
|
| 6 |
+
tags:
|
| 7 |
+
- masked-lm
|
| 8 |
+
- camembert
|
| 9 |
+
- transformers
|
| 10 |
+
- tf
|
| 11 |
+
- french
|
| 12 |
+
- fill-mask
|
| 13 |
+
---
|
| 14 |
|
| 15 |
+
# CamemBERT MLM - Fine-tuned Model
|
| 16 |
+
|
| 17 |
+
This is a TensorFlow-based masked language model (MLM) based on the [camembert-base](https://huggingface.co/camembert-base) checkpoint, a RoBERTa-like model trained on French text.
|
| 18 |
+
|
| 19 |
+
## Model description
|
| 20 |
+
|
| 21 |
+
This model uses the CamemBERT architecture, which is a RoBERTa-based transformer trained on large-scale French corpora (e.g., OSCAR, CCNet). It's designed to perform Masked Language Modeling (MLM) tasks.
|
| 22 |
+
|
| 23 |
+
It was loaded and saved using the `transformers` library in TensorFlow (`TFAutoModelForMaskedLM`). It can be used for fill-in-the-blank tasks in French.
|
| 24 |
+
|
| 25 |
+
## Intended uses & limitations
|
| 26 |
+
|
| 27 |
+
### Intended uses
|
| 28 |
+
- Fill-mask predictions in French
|
| 29 |
+
- Feature extraction for NLP tasks
|
| 30 |
+
- Fine-tuning on downstream tasks like text classification, NER, etc.
|
| 31 |
+
|
| 32 |
+
### Limitations
|
| 33 |
+
- Works best with French text
|
| 34 |
+
- May not generalize well to other languages
|
| 35 |
+
- Cannot be used for generative tasks (e.g., translation, text generation)
|
| 36 |
+
|
| 37 |
+
## How to use
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
from transformers import TFAutoModelForMaskedLM, AutoTokenizer
|
| 41 |
+
import tensorflow as tf
|
| 42 |
+
|
| 43 |
+
model = TFAutoModelForMaskedLM.from_pretrained("Mhammad2023/my-dummy-model")
|
| 44 |
+
tokenizer = AutoTokenizer.from_pretrained("Mhammad2023/my-dummy-model")
|
| 45 |
+
|
| 46 |
+
inputs = tokenizer("J'aime le [MASK] rouge.", return_tensors="tf")
|
| 47 |
+
outputs = model(**inputs)
|
| 48 |
+
logits = outputs.logits
|
| 49 |
+
|
| 50 |
+
masked_index = tf.argmax(inputs.input_ids == tokenizer.mask_token_id, axis=1)[0]
|
| 51 |
+
predicted_token_id = tf.argmax(logits[0, masked_index])
|
| 52 |
+
predicted_token = tokenizer.decode([predicted_token_id])
|
| 53 |
+
|
| 54 |
+
print(f"Predicted word: {predicted_token}")
|
| 55 |
+
|
| 56 |
+
## Limitations and bias
|
| 57 |
+
This model inherits the limitations and biases from the camembert-base checkpoint, including:
|
| 58 |
+
|
| 59 |
+
Potential biases from the training data (e.g., internet corpora)
|
| 60 |
+
|
| 61 |
+
## Inappropriate predictions for sensitive topics
|
| 62 |
+
|
| 63 |
+
Use with caution in production or sensitive applications.
|
| 64 |
+
|
| 65 |
+
## Training data
|
| 66 |
+
The model was not further fine-tuned; it is based directly on camembert-base, which was trained on:
|
| 67 |
+
|
| 68 |
+
OSCAR (Open Super-large Crawled ALMAnaCH coRpus)
|
| 69 |
+
|
| 70 |
+
CCNet (Common Crawl News)
|
| 71 |
+
|
| 72 |
+
## Training procedure
|
| 73 |
+
No additional training was applied for this version. You can load and fine-tune it on your task using Trainer or Keras API.
|
| 74 |
+
|
| 75 |
+
## Evaluation results
|
| 76 |
+
This version has not been evaluated on downstream tasks. For evaluation metrics and benchmarks, refer to the original camembert-base model card.
|