resume_analyser / models /load_models.py
bangaboy's picture
Create models/load_models.py
537dfb9 verified
raw
history blame contribute delete
447 Bytes
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")