nouhadziri / THRED

The implementation of the paper "Augmenting Neural Response Generation with Context-Aware Topical Attention"
https://arxiv.org/abs/1811.01063
MIT License
111 stars 25 forks source link

string indices must be integers #4

Closed Zengpr closed 5 years ago

Zengpr commented 5 years ago

Subreddit whitelist provided with size 95 Error occurred at 11: string indices must be integers Traceback (most recent call last): File "corpora/reddit/reddit_parser.py", line 473, in parse(submissions_input, params, _convert_submission_to_post) File "corpora/reddit/reddit_parser.py", line 305, in parse raise e File "corpora/reddit/reddit_parser.py", line 256, in parse normalized_text = normalize_post_text(post.text, charmap) File "corpora/reddit/reddit_parser.py", line 136, in normalize_post_text normalized = strip_emojis_and_emoticons(normalized).strip() File "/home/zengpr/open/PycharmProjects/2019-01/THRED-master/util/nlp.py", line 144, in strip_emojis_and_emoticons return _strip_emoticons(_strip_emojis(text)) File "/home/zengpr/open/PycharmProjects/2019-01/THRED-master/util/nlp.py", line 166, in _strip_emoticons emoticon = em['value'] TypeError: string indices must be integers

nouhadziri commented 5 years ago

Can you please provide a sample file so we can reproduce the error and fix it? Also, can you tell us whether you're parsing the submissions or the comments?

Thank you.

nouhadziri commented 5 years ago

The problem can be solved by installing version 1.0 of emot. I think you have installed the latest version. Hope this helps.