nilc-nlp/word2vec-cbow-100d
NILC Portuguese Word Embeddings — Word2Vec CBOW 100d
This repository contains the Word2Vec CBOW 100d model in safetensors format.
About
NILC-Embeddings is a repository for storing and sharing word embeddings for the Portuguese language. The goal is to provide ready-to-use vector resources for Natural Language Processing (NLP) and Machine Learning tasks.
The embeddings were trained on a large Portuguese corpus (Brazilian + European), composed of 17 corpora (~1.39B tokens). Training was carried out with the following algorithms: Word2Vec, FastText, Wang2Vec, and GloVe.
📂 Files
embeddings.safetensors→ embedding matrix ([vocab_size, 100])vocab.txt→ vocabulary (one token per line, aligned with rows)
🚀 Usage
from huggingface_hub import hf_hub_download
from safetensors.numpy import load_file
path = hf_hub_download(repo_id="nilc-nlp/word2vec-cbow-100d",
filename="embeddings.safetensors")
data = load_file(path)
vectors = data["embeddings"]
vocab_path = hf_hub_download(repo_id="nilc-nlp/word2vec-cbow-100d",
filename="vocab.txt")
with open(vocab_path) as f:
vocab = [w.strip() for w in f]
print(vectors.shape)Or in PyTorch:
from safetensors.torch import load_file
tensors = load_file("embeddings.safetensors")
vectors = tensors["embeddings"] # torch.Tensor📊 Corpus
The embeddings were trained on a combination of 17 corpora (~1.39B tokens):
📖 Paper
Portuguese Word Embeddings: Evaluating on Word Analogies and Natural Language Tasks Hartmann, N. et al. (2017), STIL 2017. ArXiv Paper
BibTeX
@inproceedings{hartmann-etal-2017-portuguese,
title = {{P}ortuguese Word Embeddings: Evaluating on Word Analogies and Natural Language Tasks},
author = {Hartmann, Nathan and Fonseca, Erick and Shulby, Christopher and Treviso, Marcos and Silva, J{'e}ssica and Alu{'i}sio, Sandra},
year = 2017,
month = oct,
booktitle = {Proceedings of the 11th {B}razilian Symposium in Information and Human Language Technology},
publisher = {Sociedade Brasileira de Computa{\c{c}}{\~a}o},
address = {Uberl{\^a}ndia, Brazil},
pages = {122--131},
url = {https://aclanthology.org/W17-6615/},
editor = {Paetzold, Gustavo Henrique and Pinheiro, Vl{'a}dia}
}📜 License
Creative Commons Attribution 4.0 International (CC BY 4.0)
