| 115 | return result |
| 116 | |
| 117 | def begin_inference(self, orig_item, preproc_item): |
| 118 | ## TODO: Don't hardcode train |
| 119 | #valid, validation_info = self.preproc.enc_preproc.validate_item(item, 'train') |
| 120 | #if not valid: |
| 121 | # return None |
| 122 | #enc_input = self.preproc.enc_preproc.preprocess_item(item, validation_info) |
| 123 | |
| 124 | enc_input, _ = preproc_item |
| 125 | if self.decoder.visualize_flag: |
| 126 | print('question:') |
| 127 | print(enc_input['question']) |
| 128 | print('columns:') |
| 129 | print(enc_input['columns']) |
| 130 | print('tables:') |
| 131 | print(enc_input['tables']) |
| 132 | if getattr(self.encoder, 'batched'): |
| 133 | enc_state, = self.encoder([enc_input]) |
| 134 | else: |
| 135 | enc_state = self.encoder(enc_input) |
| 136 | return self.decoder.begin_inference(enc_state, orig_item) |