(results, data)
| 145 | ## fuzzywuzzy |
| 146 | ######################## |
| 147 | def caculate_fuzz(results, data): |
| 148 | scores = 0 |
| 149 | for output_id in range(len(results)): |
| 150 | prediction = results[output_id] |
| 151 | target = data[output_id] |
| 152 | if prediction == "" or target == "": |
| 153 | continue |
| 154 | scores += fuzz.ratio(prediction, target) |
| 155 | avg_score = scores / len(results) |
| 156 | return avg_score |
| 157 | |
| 158 | |
| 159 | ######################## |