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

View Scores NoneType not subscriptable #27

Closed
smart-patrol opened this issue Jan 25, 2020 · 1 comment
Closed

View Scores NoneType not subscriptable #27

smart-patrol opened this issue Jan 25, 2020 · 1 comment

Comments

@smart-patrol
Copy link

When running the following for scores like Rouge and others like:

vizseq.view_scores(ref, hypo, ['metric that's not bleu'], tags=tag)

I am getting:

~/.local/lib/python3.6/site-packages/vizseq/scorers/__init__.py in _score_multiprocess_averaged(self, hypothesis, references, tags, sent_score_func)
    170             for t in tag_set:
    171                 indices = [i for i, cur in enumerate(tags) if t in cur]
--> 172                 group_scores[t] = np.mean([sent_scores[i] for i in indices])
    173 
    174         return VizSeqScore.make(

~/.local/lib/python3.6/site-packages/vizseq/scorers/__init__.py in <listcomp>(.0)
    170             for t in tag_set:
    171                 indices = [i for i, cur in enumerate(tags) if t in cur]
--> 172                 group_scores[t] = np.mean([sent_scores[i] for i in indices])
    173 
    174         return VizSeqScore.make(

TypeError: 'NoneType' object is not subscriptable

Any idea why that's going on? Using text data this is at least 3 tokens or more.

This works fine when running view_examples.

kahne added a commit that referenced this issue Apr 26, 2020
@kahne kahne mentioned this issue Apr 26, 2020
kahne added a commit that referenced this issue Apr 26, 2020
@kahne
Copy link
Contributor

kahne commented Apr 26, 2020

@smart-patrol

Sorry for late reply and thank you very much for reporting this issue!

This bug has been fixed in #31 . Please upgrade VizSeq with pip install --upgrade vizseq or pull the latest master branch and reinstall VizSeq with pip install -e <github repo root>.

Thanks again for your support on VizSeq!

@kahne kahne closed this as completed Apr 26, 2020
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