Created
February 14, 2019 09:26
-
-
Save HarshSingh16/26763fc3a89567d85f2be5702b555a86 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creating a list of all of the conversations | |
conversations_ids = [] | |
for conversation in conversations[:-1]: | |
_conversation = conversation.split(' +++$+++ ')[-1][1:-1].replace("'", "").replace(" ", "") | |
conversations_ids.append(_conversation.split(',')) | |
# Getting separately the questions and the answers | |
questions = [] | |
answers = [] | |
for conversation in conversations_ids: | |
for i in range(len(conversation) - 1): | |
questions.append(id2line[conversation[i]]) | |
answers.append(id2line[conversation[i+1]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment