Spaces:
Sleeping
Sleeping
import spacy | |
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline | |
# Load SpaCy model | |
nlp_spacy = spacy.load('en_core_web_sm') | |
# Load NER model | |
tokenizer = AutoTokenizer.from_pretrained("Babelscape/wikineural-multilingual-ner") | |
model = AutoModelForTokenClassification.from_pretrained("Babelscape/wikineural-multilingual-ner") | |
nlp_ner = pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy="simple") | |