SforAiDl / decepticonlp

Python Library for Robustness Monitoring and Adversarial Debugging of NLP models
MIT License
15 stars 10 forks source link

Metrics #18

Closed someshsingh22 closed 4 years ago

someshsingh22 commented 4 years ago
  1. Levenshtein Edit Distance Added with polynomial complexity (numpy optimized)

    • LCS and Sum normalization Available as arg
  2. Jaccard Distance Done

  3. Euclidean Distances complete

    • normalization available
    • CountVectorzier Space issue resolved (only numpy is used)
Sharad24 commented 4 years ago

Resolves #15

codecov-io commented 4 years ago

Codecov Report

Merging #18 into master will increase coverage by 8.92%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
+ Coverage   79.16%   88.09%   +8.92%     
==========================================
  Files           4        5       +1     
  Lines          48       84      +36     
==========================================
+ Hits           38       74      +36     
  Misses         10       10              
Impacted Files Coverage Δ
decepticonlp/metrics/char_metrics.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c93cde8...cc4c9fc. Read the comment docs.

Sharad24 commented 4 years ago

Ok sounds good. Put tests in tests though

Sharad24 commented 4 years ago

Would be better if we follow the same directory structure in tests. So yours will be in tests/test_metrics/....py

someshsingh22 commented 4 years ago

I dont get you @rajaswa, Where have we done the unit testing before ? I have tested all functionalities up to metrics from the root dir. there is no .tests rn I guess

Sharad24 commented 4 years ago

He meant tests I guess.

someshsingh22 commented 4 years ago

Ok, I actually don't know how that works, any link ?

Sharad24 commented 4 years ago

What?

someshsingh22 commented 4 years ago

Update: Metrics are also added, for floating-point errors absolute error is checked with a tolerance of 1e-5