Downloads · 30 days
11
6% of all-time downloads
paulbontempo/bert-tagalog-dependency-cl
bert-tagalog-dependency-cl is a feature extraction model from paulbontempo. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as mit.
This is a BERT model for Tagalog with token embeddings fine-tuned using contrastive learning on dependency parse tree structures.
Downloads · 30 days
11
6% of all-time downloads
All-time downloads
199
Public
Repo size
2.1 GB
Likes
0
Public
Click a slice to open those files.
.pt715 MB · 50%
From the Hugging Face model README
This is a BERT model for Tagalog with token embeddings fine-tuned using contrastive learning on dependency parse tree structures.
We use a novel approach to encode syntactic structure directly into token embeddings:
Standard BERT architecture with fine-tuned token embeddings:
The contrastive learning stage used:
This is a standard HuggingFace BERT model and can be used like any other BERT:
from transformers import AutoModel, AutoTokenizer
# Load model and tokenizer
model = AutoModel.from_pretrained("paulbontempo/bert-tagalog-dependency-cl")
tokenizer = AutoTokenizer.from_pretrained("paulbontempo/bert-tagalog-dependency-cl")
# Use for embeddings
text = "Magandang umaga sa lahat"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
# Get token embeddings
token_embeddings = outputs.last_hidden_state
Fine-tune on your Tagalog NLP task:
from transformers import AutoModelForSequenceClassification
# For classification tasks
model = AutoModelForSequenceClassification.from_pretrained(
"paulbontempo/bert-tagalog-dependency-cl",
num_labels=3
)
# Train on your task
# ...
This model is designed as a pre-trained base for downstream Tagalog NLP tasks. The quality of embeddings can be evaluated through:
If you use this model in your research, please cite:
@misc{bert-tagalog-dependency-cl,
author = {Paul Bontempo},
title = {Tagalog BERT with Dependency-Aware Contrastive Learning},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/paulbontempo/bert-tagalog-dependency-cl}}
}