Skip to content

Instantly share code, notes, and snippets.

@HarshSingh16
Created February 8, 2019 21:24
Show Gist options
  • Save HarshSingh16/271dee9967095197ad056ff2d276ded8 to your computer and use it in GitHub Desktop.
Save HarshSingh16/271dee9967095197ad056ff2d276ded8 to your computer and use it in GitHub Desktop.
#Conveting questions and answers into sequence of integers
questions_int_sequence=[]
for question in Clean_questions:
int=[]
for word in question.split():
if word not in dict_word2integer:
int.append("<OUT>")
else:
int.append(dict_word2integer[word])
questions_int_sequence.append(int)
answers_int_sequence=[]
for answer in new_clean_answers:
int=[]
for word in answer.split():
if word not in dict_word2integer:
int.append("<OUT>")
else:
int.append(dict_word2integer[word])
answers_int_sequence.append(int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment