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

Code for Evaluation Measures (PPL & distinct-1 & distinct-2) #9

Closed
XL2248 opened this issue Jan 19, 2020 · 1 comment
Closed

Code for Evaluation Measures (PPL & distinct-1 & distinct-2) #9

XL2248 opened this issue Jan 19, 2020 · 1 comment

Comments

@XL2248
Copy link

XL2248 commented Jan 19, 2020

I can not find the code for this part. Do you give me some informaiton about this? Many thanks.

@zhanghainan
Copy link
Owner

zhanghainan commented Feb 27, 2020

PPL = log(eval_loss)

pred={}
num=0
for line in generation:
    for ww in line:
        if ww not in pred:
            pred[ww]=0
        pred[ww]+=1
        num+=1
distinct-1 = len(pred)/num

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