--- language: es license: cc-by-nc-sa-4.0 tags: - ner - token-classification - bilstm - crf - conll2002 pipeline_tag: token-classification datasets: - conll2002 metrics: - f1 - precision - recall --- # bilstm-crf-fasttext NER CoNLL-2002 (bs=16) BiLSTM + CRF con embeddings **FastText español** (cc.es.300). Entrenado sobre CoNLL-2002 español. Modelo CUSTOM con `trust_remote_code=True`. ## Métricas en test (CoNLL-2002) | Metric | Valor | |:------:|:-----:| | F1 | **0.8079** | | Precision | 0.8129 | | Recall | 0.8030 | ## Uso ```python # Requiere: pip install pytorch-crf from transformers import AutoModelForTokenClassification, AutoConfig import json config = AutoConfig.from_pretrained("cvalenciaunivalle/bilstm-crf-fasttext-conll-bs16", trust_remote_code=True) model = AutoModelForTokenClassification.from_pretrained("cvalenciaunivalle/bilstm-crf-fasttext-conll-bs16", 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-bs16", "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']] ``` ## Detalles - Arquitectura: BiLSTM hidden=200, dropout=0.3, CRF de salida - Word embeddings: 300d (FastText) - Batch size: 16, épocas: 10 - Compañeros: Laura Valero, Cristian Valencia - Taller PLN — Maestría Univalle