Skip to content

load('zh_core_web_trf-3.8.0') cause Can't find factory for 'curated_transformer' for language Chinese (zh) #13805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TChengZ opened this issue Apr 22, 2025 · 1 comment

Comments

@TChengZ
Copy link

TChengZ commented Apr 22, 2025

How to reproduce the behaviour

1、i download the zh_core_web_trf-3.8.0 from https://github.com/explosion/spacy-models/releases/tag/zh_core_web_trf-3.8.0
2、i unzip the download file and write the code like below

 local_path = './../zh_core_web_trf-3.8.0'
 nlp = spacy.load(local_path)
       
doc = nlp(text)

then the error happen:
Can't find factory for 'curated_transformer' for language Chinese (zh). This usually happens when spaCy calls nlp.create_pipe with a custom component name that's not registered on the current language class. If you're using a custom component, make sure you've added the decorator @Language.component (for function components) or @Language.factory (for class components).\n\nAvailable factories: attribute_ruler, tok2vec, merge_noun_chunks, merge_entities, merge_subtokens, token_splitter, doc_cleaner, parser, beam_parser, lemmatizer, trainable_lemmatizer, entity_linker, entity_ruler, tagger, morphologizer, ner, beam_ner, senter, sentencizer, spancat, spancat_singlelabel, span_finder, future_entity_ruler, span_ruler, textcat, textcat_multilabel

Your Environment

  • Operating System:MACOS 15.1.1 (24B2091)

  • Python Version Used: Python 3.10.11

  • spaCy Version Used:

  • Name: spacy
    Version: 3.8.5
    Summary: Industrial-strength Natural Language Processing (NLP) in Python
    Home-page: https://spacy.io
    Author: Explosion
    Author-email: [email protected]
    License: MIT
    Location: /Users/chenzujie/work/Autobots/autobots_backend/.venv/lib/python3.10/site-packages
    Requires: catalogue, cymem, jinja2, langcodes, murmurhash, numpy, packaging, preshed, pydantic, requests, setuptools, spacy-legacy, spacy-loggers, srsly, thinc, tqdm, typer, wasabi, weasel

  • Environment Information:

@TChengZ
Copy link
Author

TChengZ commented Apr 28, 2025

i fixed the problem,when use local model file,you need to

pip install spacy==3.8.5
pip install spacy-curated-transformers==0.3.0
pip install spacy-pkuseg==1.0.0

@TChengZ TChengZ closed this as completed Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant