Skip to content

Instantly share code, notes, and snippets.

@Jirayut558
Created December 28, 2018 06:16
Show Gist options
  • Save Jirayut558/79bc5fa92f5d089610888e9ee6689679 to your computer and use it in GitHub Desktop.
Save Jirayut558/79bc5fa92f5d089610888e9ee6689679 to your computer and use it in GitHub Desktop.
def load_data(datafile):
dataX = []
dataY = []
data = open(datafile, "r").read().lower()
for i in data.split("\n\n"):
a = i.split("\n")
question = a[0]
answer = a[1]
dataX.append(question)
dataY.append(answer)
return dataX,dataY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment