(x)
| 55 | |
| 56 | |
| 57 | def transform(x): |
| 58 | x_transform = [] |
| 59 | for i, word_indices in enumerate(x): |
| 60 | BoW_array = np.zeros((NUM_WORDS,)) |
| 61 | for index in word_indices: |
| 62 | if index < len(BoW_array): |
| 63 | BoW_array[index] += 1 |
| 64 | x_transform.append(BoW_array) |
| 65 | return np.array(x_transform) |
| 66 | |
| 67 | |
| 68 | class CustomKerasModelWrapper(ModelWrapper): |
no outgoing calls
no test coverage detected