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

Opinion_miner can't find token_id's #34

Open
wmkouw opened this issue May 14, 2018 · 2 comments
Open

Opinion_miner can't find token_id's #34

wmkouw opened this issue May 14, 2018 · 2 comments

Comments

@wmkouw
Copy link
Contributor

wmkouw commented May 14, 2018

Goal: run opinion miner on input naf file.

Input:

(cat "$fn-cor.naf" | python2 $OPI/tag_file.py -f $OPI/models/models_news_nl/ > "$fn-opi.naf" 2> "$fn-opi.log") 2> "$fn-opi.err"

Problem: can't find certain token_id's (corresponding to word id)

Stack trace:

Traceback (most recent call last):
  File "/opinion_miner_deluxePP/tag_file.py", line 175, in <module>
    feature_file = expression_feature_extractor(kaf_naf_obj,'tag', model_folder, log=args.log)
  File "/opinion_miner_deluxePP/extract_features_expression.py", line 581, in main
    create_sequence(naf_obj, sentence_id, overall_parameters, list_opinions = [],output = output_fd, log=log)
  File "/opinion_miner_deluxePP/extract_features_expression.py", line 283, in create_sequence
    feature_labels = extract_terms_pos(naf_obj,token_ids, features)
  File "/opinion_miner_deluxePP/extract_features_expression.py", line 108, in extract_terms_pos
    term_id = naf_obj.termid_for_tokenid[token_id]
KeyError: 'w4747'
@wmkouw
Copy link
Contributor Author

wmkouw commented May 14, 2018

KeyError also randomly occurring for alpinonaf

@wmkouw
Copy link
Contributor Author

wmkouw commented May 14, 2018

Problem is most likely due to missing xml files (see #28). I've passed the list without the missing files through, but there are probably still dictionary keys referring to the missing files.

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