jind11 / TextFooler

A Model for Natural Language Attack on Text Classification and Inference
MIT License
485 stars 79 forks source link

question about sim_scores #36

Open zedzx1uv opened 3 years ago

zedzx1uv commented 3 years ago

Hi, i find that in your code the sim_score is defined as ‘1-arccos(cos<x1,x2>)=1-<x1,x2>’, which makes me confused. Why not use cosine similarity? Is it because ‘1-<x1,x2>’ makes them more distinguishable?

jind11 commented 3 years ago

This code is borrowed from the official code of "USE". I think it is just because it is closer to the mathematical definition of cosine similarity. I am not sure whether it is really better than cos<x1,x2>.