text_plain_output_2.png text_plain_output_1.png
from nltk.corpus import stopwords

from tqdm import tqdm

import spacy

stop_words = stopwords.words('english')
cord_stopwords = ['doi', 'preprint', 'copyright', 'peer', 'reviewed', 'org', 'https', 'et', 'al', 'author', 'figure', 'rights', 'reserved', 'permission', 'used', 'using', 'biorxiv', 'medrxiv', 'license', 'fig', 'fig.', 'al.', 'Elsevier', 'PMC', 'CZI', '-PRON-', 'abstract']
for word in tqdm(cord_stopwords):
    if word not in stop_words:
        stop_words.append(word)
    else:
        continue

nlp_lg = spacy.load('en_core_sci_lg', disable=['tagger', 'parser', 'ner'])
nlp_lg.max_length = 2000000

for w in tqdm(stop_words):
    nlp_lg.vocab[w].is_stop = True