| 33 | */ |
| 34 | template<typename T> |
| 35 | std::string DecodeOutput(std::vector<T>& contextToProcess) |
| 36 | { |
| 37 | int rowLength = 29; |
| 38 | |
| 39 | std::vector<char> unfilteredText; |
| 40 | |
| 41 | for(int row = 0; row < contextToProcess.size()/rowLength; ++row) |
| 42 | { |
| 43 | std::vector<int16_t> rowVector; |
| 44 | for(int j = 0; j < rowLength; ++j) |
| 45 | { |
| 46 | rowVector.emplace_back(static_cast<int16_t>(contextToProcess[row * rowLength + j])); |
| 47 | } |
| 48 | |
| 49 | int maxIndex = std::distance(rowVector.begin(), std::max_element(rowVector.begin(), rowVector.end())); |
| 50 | unfilteredText.emplace_back(this->m_labels.at(maxIndex)[0]); |
| 51 | } |
| 52 | |
| 53 | std::string filteredText = FilterCharacters(unfilteredText); |
| 54 | return filteredText; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * @brief Function to filter out unwanted characters |
no test coverage detected