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

About the inferring of aspect polarity #11

Closed
ccscute opened this issue Aug 10, 2020 · 7 comments
Closed

About the inferring of aspect polarity #11

ccscute opened this issue Aug 10, 2020 · 7 comments

Comments

@ccscute
Copy link

ccscute commented Aug 10, 2020

Your work is great!
However, when I run the polarity judgment, the following error occurred:

opt.seed = int(opt.state_dict_path.split('seed')[1])
AttributeError: 'Namespace' object has no attribute 'state_dict_path'

I have put the saved state-dicts in the infer_dataset directory, and modified the model_name and dataset.

@ccscute
Copy link
Author

ccscute commented Aug 10, 2020

I put all the generated state_dict into it, or each data set only needs to put the last one?

@yangheng95
Copy link
Owner

The script indentified the file name contained 'acc' as state-dict, see https://github.com/yangheng95/LC-ABSA/blob/c945a94e0f86116c5578245aa9ad36c46c7b9c4a/apc_infer.py#L149

And each file only need one.

@yangheng95
Copy link
Owner

Tell me if any problem continues

@ccscute
Copy link
Author

ccscute commented Aug 10, 2020

To match your example, I used dataset 'car'
like this
图片But this problem still exists

@ccscute
Copy link
Author

ccscute commented Aug 10, 2020

{
  "config1": {
    "model_name": "lcf_bert",
    "dataset": "car",
    "optimizer": "adam",
    "learning_rate": 0.00002,
    "dropout": 0.1,
    "l2reg": 0.00001,
    "num_epoch": 5,
    "batch_size": 4,
    "logdir": "logs",
    "pretrained_bert_name": "bert-base-chinese",
    "use_dual_bert": false,
    "use_bert_spc": true,
    "max_seq_len": 80,
    "SRD": 5,
    "sigma": 0.5,
    "lcf": "cdw",
    "lce": true,
    "lcp": true,
    "exp_rounds": 1
  }
}

@yangheng95
Copy link
Owner

Seems there is no seed in the file name. It is recommended to use the auto-generated state-dict file.
e.g. lce_bert_car_acc72.98_seed0seed

@ccscute
Copy link
Author

ccscute commented Aug 10, 2020

I am sorry to trouble you with such a simple question.
I can run it successfully, thank you!

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

2 participants