eriktks/conll2002
Updated • 976 • 11
BiLSTM + CRF con embeddings FastText español (cc.es.300).
Entrenado sobre CoNLL-2002 español. Modelo CUSTOM con trust_remote_code=True.
| Metric | Valor |
|---|---|
| F1 | 0.7973 |
| Precision | 0.8109 |
| Recall | 0.7842 |
# Requiere: pip install pytorch-crf
from transformers import AutoModelForTokenClassification, AutoConfig
import json
config = AutoConfig.from_pretrained("cvalenciaunivalle/bilstm-crf-fasttext-conll-bs8", trust_remote_code=True)
model = AutoModelForTokenClassification.from_pretrained("cvalenciaunivalle/bilstm-crf-fasttext-conll-bs8", trust_remote_code=True)
# Cargar vocab (incluye word2idx, char2idx, id2tag)
from huggingface_hub import hf_hub_download
vocab_path = hf_hub_download("cvalenciaunivalle/bilstm-crf-fasttext-conll-bs8", "vocab.json")
with open(vocab_path) as f:
vocab = json.load(f)
# Predecir
oraciones_tokenizadas = [["Juan", "vive", "en", "Bogotá", "."]]
tags = model.predict(oraciones_tokenizadas, vocab)
print(tags) # [['B-PER', 'O', 'O', 'B-LOC', 'O']]
Arquitectura: BiLSTM hidden=200, dropout=0.3, CRF de salida
Word embeddings: 300d (FastText)
Batch size: 8, épocas: 10
Compañeros: Laura Valero, Cristian Valencia
Taller PLN — Maestría Univalle