'How do I change the order of recognized characters in CRNN networks(python)
I have been searching for a long time on the Internet, but to no avail. Please, I need help or some ideas about how to achieve this. For example, the recognition character is apple, so if I want to put the "A" in apple at the end of the word, like "pplea":
a-p-p-l-e ==> pplea
I don't know where to modify it, is it from the encoding or the decoding? If so, how should it be modified?
Solution 1:[1]
The following may help:
word = "apple"
def word_converter():
word2 = word + word[0]
word3 = word2[1:]
print(word3)
word_converter()
Solution 2:[2]
is simple using string position index
string = "apple"
#save fist char in one variable
first_char = string[0]
#remove first char of a string
string = string[1:]
#append first char of old string at the end of my new string
string = string + first_char
#print the result
print(string)
Solution 3:[3]
Its very simple. read string indexing in python
word = 'apple'
encoded = word[1:] + word[0]
print(encoded)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Baris Ozensel |
| Solution 2 | Enrico Razzaboni |
| Solution 3 | balu |
