NER-RNN icon indicating copy to clipboard operation
NER-RNN copied to clipboard

TypeError: unorderable types: int() >= str()

Open KanimozhiU opened this issue 7 years ago • 1 comments

PRE_EMB size 22518 max sentence size is : 30 Traceback (most recent call last): File "NerMulti.py", line 213, in X_train, y_train = get_input(BASE_DIR+"/eng.train") File "NerMulti.py", line 125, in get_input temp = np.append(temp,capital(line.split()[0])) # adding capital embedding File "NerMulti.py", line 52, in capital if ord(word[0]) >= 'A' and ord(word[0]) <= 'Z': TypeError: unorderable types: int() >= str()

I am newbie to python. How to resolve this error???

KanimozhiU avatar Sep 12 '17 12:09 KanimozhiU

change this code : if ord(word[0]) >= 'A' and ord(word[0]) <= 'Z': to this : if ord(word[0]) >= '65' and ord(word[0]) <= '90':

lele0401 avatar Mar 21 '18 11:03 lele0401