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

How to evaluate by Average Normalized Levenshtein Similarity (ANLS)? #11

Open
kobrafarshidi opened this issue Jan 8, 2023 · 1 comment

Comments

@kobrafarshidi
Copy link

kobrafarshidi commented Jan 8, 2023

Hi Mr. @uakarsh
As you know I am working your source code and I am trying to evaluate by ANLS like write in article.
and I want to do that with pytorch or pytorch_lightning .
I see some guide docs, but I encounter some question. I would be grateful if you guide me.

  1. I write an algorithm in below if I'm wrong could you correct my wrong?

  2. If this algorithm is true, could you help me, how can I replace N, M, aij, oqi with your parameters in your source code?

for example, what should I put instead of aij or qoi ?

N is the total number of questions
M is the total number of GT answers per question
aij is the ground truth answer
oqi is the network’s answer for the i'th question qi

from similarity.normalized_levenshtein import NormalizedLevenshtein
def calculate_ANLS_score(aij,oqi ):
    x=[]
    NL = NormalizedLevenshtein()
    for i in range(N):
         x+= (1- NL(aij, oqi ))
    x/N
       
    
@uakarsh
Copy link
Owner

uakarsh commented Apr 12, 2023

Hi @kobrafarshidi, much sorry for late reply. Can you refer to this thread, and let me know if you still have doubt regarding the same.

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