Skip to content

Instantly share code, notes, and snippets.

@gauravbansal98
Created May 13, 2020 12:14
Show Gist options
  • Select an option

  • Save gauravbansal98/d12e1b8af84743c11f3d94fea105c2c5 to your computer and use it in GitHub Desktop.

Select an option

Save gauravbansal98/d12e1b8af84743c11f3d94fea105c2c5 to your computer and use it in GitHub Desktop.
3
4
5
6
7
8
9
10
11
12
13
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
filename = 'Flickr8k_text/Flickr8k.token.txt'
# load descriptions
doc = load_doc(filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment