Coder Social home page Coder Social logo

pkner's People

Contributors

fgh95 avatar

Stargazers

 avatar  avatar  avatar

pkner's Issues

Error when loading spacy model for inference -- add in requirements

Hi, thank you for making your code available here. The project is very interesting and I would like to try running the models on my own data (text from pharmacokinetic literature). I got an error while loading the spacy model following the instructions in the README. I have a conda environment loaded with Python 3.8.12 and installed all dependencies as per the README (including scispacy) -

>>> nlp = spacy.load("en_pk_ner")
Traceback (most recent call last):
File "", line 1, in
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/spacy/init.py", line 50, in load
return util.load_model(
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/spacy/util.py", line 324, in load_model
return load_model_from_package(name, **kwargs)
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/spacy/util.py", line 357, in load_model_from_package
return cls.load(vocab=vocab, disable=disable, exclude=exclude, config=config)
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/en_pk_ner/init.py", line 10, in load
return load_model_from_init_py(file, **overrides)
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/spacy/util.py", line 517, in load_model_from_init_py
return load_model_from_path(
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/spacy/util.py", line 392, in load_model_from_path
nlp = load_model_from_config(config, vocab=vocab, disable=disable, exclude=exclude)
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/spacy/util.py", line 429, in load_model_from_config
nlp = lang_cls.from_config(
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/spacy/language.py", line 1672, in from_config
nlp.add_pipe(
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/spacy/language.py", line 774, in add_pipe
pipe_component = self.create_pipe(
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/spacy/language.py", line 660, in create_pipe
resolved = registry.resolve(cfg, validate=validate)
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/thinc/config.py", line 746, in resolve
resolved, _ = cls._make(
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/thinc/config.py", line 795, in _make
filled, _, resolved = cls._fill(
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/thinc/config.py", line 850, in _fill
filled[key], validation[v_key], final[key] = cls._fill(
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/thinc/config.py", line 849, in _fill
promise_schema = cls.make_promise_schema(value, resolve=resolve)
File "/home/sanya/.conda/envs/ner/lib/python3.8/site-packages/thinc/config.py", line 1057, in make_promise_schema
return create_model("ArgModel", **sig_args)
File "pydantic/main.py", line 990, in pydantic.main.create_model
File "pydantic/main.py", line 299, in pydantic.main.ModelMetaclass.new
File "pydantic/fields.py", line 411, in pydantic.fields.ModelField.infer
File "pydantic/fields.py", line 342, in pydantic.fields.ModelField.init
File "pydantic/fields.py", line 451, in pydantic.fields.ModelField.prepare
File "pydantic/fields.py", line 550, in pydantic.fields.ModelField._type_analysis
File "/home/sanya/.conda/envs/ner/lib/python3.8/typing.py", line 774, in subclasscheck
return issubclass(cls, self.origin)
TypeError: issubclass() arg 1 must be a class

I found this related issue and followed instructions to fix - https://stackoverflow.com/questions/77037891/typeerror-issubclass-arg-1-must-be-a-class and was able to get it to work after adding the following 2 lines in the requirements. Just wanted to add here in case someone else has the same issue. Thanks again!

typing-inspect==0.8.0
typing_extensions==4.5.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.