allenai / allenai/scibert

Error while running Named Entity Recognition

Abierto
#97 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
1.7k
Forks
232
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I tried using SciBERT for NER using the following command-

from transformers import *

tokenizer = AutoTokenizer.from_pretrained('allenai/scibert_scivocab_uncased')
model = AutoModel.from_pretrained('allenai/scibert_scivocab_uncased')

nlp = pipeline('ner',model = model,tokenizer=tokenizer)
nlp('Clinical features of culture-proven Mycoplasma pneumoniae infections at King Abdulaziz University Hospital, Jeddah, Saudi Arabia')

While running it on a sample sentence, I get the following error-
Traceback (most recent call last):
File "", line 1, in
File "/python3.6/site-packages/transformers/pipelines.py", line 927, in __call__
for idx, label_idx in enumerate(labels_idx)
File "/python3.6/site-packages/transformers/pipelines.py", line 928, in
if self.model.config.id2label[label_idx] not in self.ignore_labels
KeyError: 422

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.