dianna
dianna copied to clipboard
The output of lime text is not consistent with rise text
For text, both methods RISE and LIME return a tuple of (token, index, importance)
, however, the output of RISE is sorted by the "index" whereas they are sorted by "importance" in LIME's output. We can sort the values in lime in the function _reshape_result_for_single_label
.
RISE example output:
[('A', 0, 0.7009708379209041),
('delectable', 1, 0.8650634929537773),
('and', 2, 0.7003263755142688),
('intriguing', 3, 1.0261991372704504),
('thriller', 4, 0.9036030551791191),
('filled', 5, 0.6704552842676639),
('with', 6, 0.7485938167572022),
('surprises', 7, 0.7003605794906616),
('and', 8, 0.7706552624702453)]
LIME example output
[('intriguing', 3, 0.15290728964252595),
('delectable', 1, 0.06392747194386154),
('thriller', 4, 0.06170429812738322),
('A', 0, 0.02412706125892299),
('and', 2, 0.021543642932292974),
('filled', 5, -0.013505093974254312),
('with', 6, 0.010936157339420459),
('surprises', 7, 0.0031371849149267623)]
As discussed in standup, we decided to sort the output of the lime method by index.