AttributeError: 'English' object has no attribute 'predict

I have trained NER model from spacy version 3.2 and trying to predict with my text and below error i am facing AttributeError: 'English' object has no attribute 'predict.

python 3.7 spacy 3.2 using Mac-book-pro

here my code:

import pickle

cv_sections_model1 = pickle.load(open(ml_models/cv_sectionsv3.pkl, rb))

def predict_sections(self):
        global cv_sections_model1
        # remove strings with only special characters
        sections = [
            section
            for section in self.sections
            if len(re.sub(r[^a-z0-9 ], , section.lower()).strip())  3
        ]
        predicted = cv_sections_model1.predict(sections)
        print(predicted)
        predicted_sections = [zipped for zipped in zip(sections, predicted)]
        tic = time.perf_counter()
        for sec in predicted_sections:
            self.form_output(sec)
        job_title_sections =  .join(self.cv_output[personal_statement]) +  .join(
            self.cv_output[experience]
        )
        return job_title_sections

error

in predict_sections\n    predicted = cv_sections_model1.predict(sections)\nAttributeError: 'English' object has no attribute 'predict'\n, filename: app.py}

Topic spacy

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.