yangheng95 / PyABSA

Sentiment Analysis, Text Classification, Text Augmentation, Text Adversarial defense, etc.;
https://pyabsa.readthedocs.io
MIT License
909 stars 153 forks source link

spaCy model #95

Closed lpfy closed 2 years ago

lpfy commented 2 years ago

https://github.com/yangheng95/PyABSA/blob/7ef6bceb06d4db02ed2321ed9daa89fbf0349545/pyabsa/core/apc/classic/__bert__/dataset_utils/dependency_graph.py#L21

and

https://github.com/yangheng95/PyABSA/blob/7ef6bceb06d4db02ed2321ed9daa89fbf0349545/pyabsa/core/apc/classic/__glove__/dataset_utils/dependency_graph.py#L21

As my env only has spaCy en_lg model installed, so error message was popped up even for checking available_checkpoints(). These two places seem hardcoded to load en_sm only. Not sure why not use function configure_spacy_model(opt) here?

https://github.com/yangheng95/PyABSA/blob/7ef6bceb06d4db02ed2321ed9daa89fbf0349545/pyabsa/core/apc/dataset_utils/apc_utils.py#L383

yangheng95 commented 2 years ago

I am sorry for that. I developed each feature in different elapses, and it is hard for me to test all situations solo. So I hope the community can contribute to this repo, such as reporting a bug. I will appreciate it if you fix it and PR. However, never mind if you feel it is perplexing to fix, I will fix it in the next version.

lpfy commented 2 years ago

I am very interesting to this project, so I am happy to contribute when I can. But as the lack of instructions and I only briefly looked code structures, still learning your code, I tend to ask questions first. Because I am afraid you have special purpose to hardcoded something. From your reply, seems you have no special purpose for these two places, so I will PR it.

The other question is opt parameter, could you please point out the where this class is(presumably this is a class for set global options) and how to set value?

yangheng95 commented 2 years ago

The default paramters are set here: https://github.com/yangheng95/PyABSA/blob/release/pyabsa/functional/config/apc_config_manager.py and the difination of opt is here: https://github.com/yangheng95/PyABSA/blob/release/pyabsa/functional/config/config_manager.py. Ecah can set value just like Namespace.

yangheng95 commented 2 years ago

Never mind for everyone to ask Qs and contribute, and I will help to check the PR before release a PyPi package.