YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

🧠 FillMask-BERT-FineTuned

A BERT-based masked language model fine-tuned on the wikitext dataset. This model predicts missing words in a sentence using the [MASK] token and provides the most probable replacements with confidence scores. It’s useful for tasks like autocomplete, suggestion engines, or masked word prediction.


✨ Model Highlights
πŸ“Œ Based on bert-base-uncased (by Google)
πŸ” Fine-tuned on the wikitext dataset
🧠 Predicts masked tokens using contextual understanding
πŸ’Ύ Available in both full and quantized versions
πŸš€ Compatible with pipeline('fill-mask') from πŸ€— Transformers


🧠 Intended Uses

  • Autocompletion systems
  • Language understanding tasks
  • Educational language games or language modeling research

🚫 Limitations

  • Trained only on English
  • May not handle proper nouns or rare entities well
  • Long sentences (>128 tokens) are truncated during training
  • Not suitable for generation tasks (e.g., summarization, translation)

πŸ‹οΈβ€β™‚οΈ Training Details

  • Base Model: bert-base-uncased
  • Dataset: wikitext-2-raw-v1
  • Framework: PyTorch with πŸ€— Transformers
  • Epochs: 5
  • Batch Size: 16
  • Max Length: 128 tokens
  • Loss: CrossEntropyLoss (Masked LM)
  • Optimizer: AdamW
  • Device: Trained on NVIDIA CUDA-enabled GPU

πŸ“Š Evaluation Metrics (manual evaluation)

Metric Value
Mask Accuracy (Top-1) ~34% on simple examples
Mask Accuracy (Top-5) ~90% on simple examples

This is illustrative. Replace with actual if you log accuracy/f1 during testing.


πŸ”€ Tokenizer
The tokenizer is based on the bert-base-uncased vocabulary and saved with the model. Includes:

  • tokenizer_config.json
  • vocab.txt
  • special_tokens_map.json

πŸš€ Usage

from transformers import pipeline

model = "your-username/fill-mask-bert-finetuned"  # replace with actual repo ID
fill_mask = pipeline("fill-mask", model=model)

# Predict the masked word
output = fill_mask("The [MASK] is shining in the sky.")
for o in output:
    print(f"{o['sequence']} | Score: {o['score']:.2f}")

βš™οΈ Quantization

Post-training static quantization was applied using PyTorch to reduce model size and boost inference performance. Quantized version works identically with fill-mask pipeline.


πŸ“ Repository Structure

/fill-mask-bert-finetuned/ β”œβ”€β”€ config.json # Model configuration
β”œβ”€β”€ model.safetensors # Fine-tuned model weights
β”œβ”€β”€ special_tokens_map.json # Token mapping
β”œβ”€β”€ tokenizer_config.json # Tokenizer settings
β”œβ”€β”€ vocab.txt # Tokenizer vocabulary
β”œβ”€β”€ README.md # This model card


πŸ™ Contributing Contributions are welcome! If you have suggestions, improvements, or issues, feel free to open an issue or submit a pull request.

Downloads last month
3
Safetensors
Model size
110M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support