Skip to content
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

Error when running #235

Open
KostasGeor opened this issue Jan 2, 2025 · 5 comments
Open

Error when running #235

KostasGeor opened this issue Jan 2, 2025 · 5 comments

Comments

@KostasGeor
Copy link

I did a pip install of the package and want to run this code:

from ojd_daps_skills.pipeline.extract_skills.extract_skills import ExtractSkills

extract_skills = ExtractSkills().extract_skills('You will also resort to various data management and visualization techniques to provide insight into the data. Your portfolio of skills covers a wide range of advanced statistical and machine learning techniques for classification, prediction, recommendation, clustering, forecasting, as well as data management, data visualization, and optimization, applied in a commercial context.')

However, I get this error: "ValueError: 'in' is not a valid parameter name".

The full error log is this:

Traceback (most recent call last):
File "C:\Users\Konstantinos\PycharmProjects\NestaRun\test.py", line 1, in
from ojd_daps_skills.pipeline.extract_skills.extract_skills import ExtractSkills
File "C:\Users\Konstantinos\anaconda3\Lib\site-packages\ojd_daps_skills\pipeline\extract_skills_init_.py", line 1, in
from .extract_skills import ExtractSkills
File "C:\Users\Konstantinos\anaconda3\Lib\site-packages\ojd_daps_skills\pipeline\extract_skills\extract_skills.py", line 4, in
from ojd_daps_skills.pipeline.skill_ner.ner_spacy import JobNER
File "C:\Users\Konstantinos\anaconda3\Lib\site-packages\ojd_daps_skills\pipeline\skill_ner\ner_spacy.py", line 39, in
from spacy.util import minibatch, compounding, fix_random_seed
File "C:\Users\Konstantinos\anaconda3\Lib\site-packages\spacy_init_.py", line 14, in
from . import pipeline # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Konstantinos\anaconda3\Lib\site-packages\spacy\pipeline_init_.py", line 1, in
from .attributeruler import AttributeRuler
File "C:\Users\Konstantinos\anaconda3\Lib\site-packages\spacy\pipeline\attributeruler.py", line 6, in
from .pipe import Pipe
File "spacy\pipeline\pipe.pyx", line 1, in init spacy.pipeline.pipe
File "spacy\vocab.pyx", line 1, in init spacy.vocab
File "C:\Users\Konstantinos\anaconda3\Lib\site-packages\spacy\tokens_init_.py", line 1, in
from .doc import Doc
File "spacy\tokens\doc.pyx", line 36, in init spacy.tokens.doc
File "C:\Users\Konstantinos\anaconda3\Lib\site-packages\spacy\schemas.py", line 158, in
class TokenPatternString(BaseModel):
File "C:\Users\Konstantinos\anaconda3\Lib\site-packages\pydantic\main.py", line 292, in new
cls.signature = ClassAttribute('signature', generate_model_signature(cls.init, fields, config))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Konstantinos\anaconda3\Lib\site-packages\pydantic\utils.py", line 258, in generate_model_signature
merged_params[param_name] = Parameter(
^^^^^^^^^^
File "C:\Users\Konstantinos\anaconda3\Lib\inspect.py", line 2725, in init
raise ValueError('{!r} is not a valid parameter name'.format(name))

Any idea how to solve this??

@KostasGeor
Copy link
Author

Also, I noticed when installing the package that this path:

from ojd_daps_skills.extract_skills.extract_skills import SkillsExtractor

included in the example of the ReadMe file does not exist, Why is that??
Instead the only close one I found is from ojd_daps_skills.pipeline.extract_skills.extract_skills import ExtractSkills

@lizgzil
Copy link
Collaborator

lizgzil commented Jan 6, 2025

Hi @KostasGeor it looks like you might be using an old version of the package as the pipeline folder shouldn't exist anymore.

Is it possible to reinstall the package (to version 2.0.0) and then try:

from ojd_daps_skills.extract_skills.extract_skills import SkillsExtractor

sm = SkillsExtractor(taxonomy_name="esco”)

job_ads = [
    'You will also resort to various data management and visualization techniques to provide insight into the data. Your portfolio of skills covers a wide range of advanced statistical and machine learning techniques for classification, prediction, recommendation, clustering, forecasting, as well as data management, data visualization, and optimization, applied in a commercial context.'
]
job_ad_with_skills = sm(job_ads)

job_ad_with_skills[0]._.skill_spans

@devendra-DWT
Copy link

@lizgzil I previously used pip install git+https://github.com/nestauk/ojd_daps_skills.git@dev with the old version, but now I can't run it because a new version has been deployed in the dev branch.

@lizgzil
Copy link
Collaborator

lizgzil commented Feb 10, 2025

@devendra-DWT is there a reason you want to continue to use the old version?

@devendra-DWT
Copy link

Hi @lizgzil,

I was developing an app for a job-matching platform, and we built everything based on the V1 model. We implemented a lot of features according to the data provided by V1.

Now, when we want to test and deploy, we are unable to use it.

I’m trying to download it using a specific old commit, but I keep encountering different types of errors.

sometime like

2025-02-10 19:20:33,607 - SkillsExtractor - WARNING - Neccessary files are not downloaded. Downloading ~1GB of neccessary files. (extract_skills.py:63)
2025-02-10 19:20:34,981 - SkillsExtractor - WARNING - Error: An error occurred (403) when calling the HeadObject operation: Forbidden (download_public_data.py:32)
2025-02-10 19:20:34,982 - SkillsExtractor - INFO - Loading the model from a local location (ner_spacy.py:507)
2025-02-10 19:20:34,982 - SkillsExtractor - INFO - Loading the model from C:\Users\Admin\anaconda3\envs\myenv\Lib\site-packages\ojd_daps_skills_data/outputs/models/ner_model/20230808/ (ner_spacy.py:510)
2025-02-10 19:20:34,983 - SkillsExtractor - WARNING - Model not found locally - you may need to download it from S3 (set s3_download to True) (ner_spacy.py:517)
2025-02-10 19:20:34,983 - SkillsExtractor - INFO - Loading 'esco' taxonomy information (extract_skills.py:154)
  File "C:\Users\Admin\anaconda3\envs\myenv\lib\site-packages\ojd_daps_skills\pipeline\extract_skills\extract_skills.py", line 159, in load
    self.hier_name_mapper = load_file(
  File "C:\Users\Admin\anaconda3\envs\myenv\lib\site-packages\ojd_daps_skills\getters\data_getters.py", line 197, in load_file
    data = load_json_dict(str(PROJECT_DIR) + "/" + file_path)
  File "C:\Users\Admin\anaconda3\envs\myenv\lib\site-packages\ojd_daps_skills\getters\data_getters.py", line 52, in load_json_dict
    with open(file_name, "r") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Admin\\anaconda3\\envs\\myenv\\Lib\\site-packages/ojd_daps_skills_data/outputs/data/skill_ner_mapping/esco_hier_mapper.json'

and sometimes like

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/.local/lib/python3.8/site-packages/ojd_daps_skills/pipeline/extract_skills/extract_skills.py", line 147, in load
    self.nlp = self.job_ner.load_model(self.ner_model_path, s3_download=self.s3)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/ojd_daps_skills/pipeline/skill_ner/ner_spacy.py", line 519, in load_model
    return self.nlp
AttributeError: 'JobNER' object has no attribute 'nlp'

Please help and guide to use previous version,

thanks.

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

3 participants