Skip to content

Instantly share code, notes, and snippets.

@anddam
Last active November 5, 2016 17:10
Show Gist options
  • Save anddam/49d2103f5c31647e7c676bc3b2b4aded to your computer and use it in GitHub Desktop.
Save anddam/49d2103f5c31647e7c676bc3b2b4aded to your computer and use it in GitHub Desktop.
"""Tries to solve https://gist.github.com/jhzab/38640e3df97eb4e25c9f360f87800f54 in a better way
example file at https://gist.github.com/jhzab/d5d4aeeb01ae4094035745a549b4ea14
"""
import json
filename = 'example.json'
result = []
with open(filename) as file:
for line in file:
for value in json.loads(line)['value']:
result.append((value['token'], value['label']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment