Skip to content

Opinion_miner can't find token_id's #34

@wmkouw

Description

@wmkouw

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions