Following is my code sample.
SENTENCE = "Today is a wonderful day."
sent= (word_tokenize(SENTENCE))
cursor = conn.cursor()
cursor.execute('SELECT * FROM emotion_state WHERE key_word = %s', (sent))
results = cursor.fetchall()
for i in results:
print(i)
Here I need to check whether the words in "sent" array available in the database or not. If there are some keyword available in the database that is in the "sent" array, I need to fetch all. I'm tried in followed way and it makes the error which is
raise errorclass(errorvalue)
_mysql_exceptions.ProgrammingError: not all arguments converted during
string formatting
How can I do this comparison easily ?