# coding: utf-8

example = ",\tO\nDavos\tPERSON\n2018\tO:\tOSoros\tPERSONaccuses\tOTrump\tPERSONof\tOwanting\tOa\tO`\tOmafia\tOstate\tO'\tOand\tOblasts\tOsocial\tOmedia\tO.\tO"
example
example.split("\n")
example = ",\tO\nDavos\tPERSON\n2018\tO\n:\tO\nSoros\tPERSON\naccuses\tO\nTrump\tPERSON\nof\tO\nwanting\tO\na\tO\n`\tO\nmafia\tO\nstate\tO\n'\tO\nand\tO\nblasts\tO\nsocial\tO\nmedia\tO\n.\tO\n"
example.split("\n")
[i for i in example.split("\n")]
[i.split("\t") for i in example.split("\n")]
[i.split("\t") for i in example.split("\n")]
def list_to_prodigy(x, i):
    return {"label"=x[1], "start"=i, "end"=i}

    
    
    
def list_to_prodigy(x, i):
    return {"label": x[1], "start": i, "end": i}
    
def list_to_prodigy(x, i):
    x = x.split("\t")
    return {"label"=x[1], "start"=i, "end"=i}
def list_to_prodigy(x, i):
    x = x.split("\t")
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(i) for i in example.split("\n")]
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
example
example.split("\n")
def list_to_prodigy(x, i):
    x = x.split("\t")
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")[:-1]
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")[-1:]
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")[:-1]
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
get_ipython().run_line_magic('save', '--help')
get_ipython().run_line_magic('save', 'help')
get_ipython().run_line_magic('save', '')
get_ipython().run_line_magic('save', '-a foo')

example = ",\tO\nDavos\tPERSON\n2018\tO:\tOSoros\tPERSONaccuses\tOTrump\tPERSONof\tOwanting\tOa\tO`\tOmafia\tOstate\tO'\tOand\tOblasts\tOsocial\tOmedia\tO.\tO"
example
example.split("\n")
example = ",\tO\nDavos\tPERSON\n2018\tO\n:\tO\nSoros\tPERSON\naccuses\tO\nTrump\tPERSON\nof\tO\nwanting\tO\na\tO\n`\tO\nmafia\tO\nstate\tO\n'\tO\nand\tO\nblasts\tO\nsocial\tO\nmedia\tO\n.\tO\n"
example.split("\n")
[i for i in example.split("\n")]
[i.split("\t") for i in example.split("\n")]
[i.split("\t") for i in example.split("\n")]
def list_to_prodigy(x, i):
    return {"label"=x[1], "start"=i, "end"=i}

    
    
    
def list_to_prodigy(x, i):
    return {"label": x[1], "start": i, "end": i}
    
def list_to_prodigy(x, i):
    x = x.split("\t")
    return {"label"=x[1], "start"=i, "end"=i}
def list_to_prodigy(x, i):
    x = x.split("\t")
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(i) for i in example.split("\n")]
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
example
example.split("\n")
def list_to_prodigy(x, i):
    x = x.split("\t")
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")[:-1]
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")[-1:]
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")[:-1]
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
get_ipython().run_line_magic('save', '--help')
get_ipython().run_line_magic('save', 'help')
get_ipython().run_line_magic('save', '')
get_ipython().run_line_magic('save', '-a foo')

example = ",\tO\nDavos\tPERSON\n2018\tO:\tOSoros\tPERSONaccuses\tOTrump\tPERSONof\tOwanting\tOa\tO`\tOmafia\tOstate\tO'\tOand\tOblasts\tOsocial\tOmedia\tO.\tO"
example
example.split("\n")
example = ",\tO\nDavos\tPERSON\n2018\tO\n:\tO\nSoros\tPERSON\naccuses\tO\nTrump\tPERSON\nof\tO\nwanting\tO\na\tO\n`\tO\nmafia\tO\nstate\tO\n'\tO\nand\tO\nblasts\tO\nsocial\tO\nmedia\tO\n.\tO\n"
example.split("\n")
[i for i in example.split("\n")]
[i.split("\t") for i in example.split("\n")]
[i.split("\t") for i in example.split("\n")]
def list_to_prodigy(x, i):
    return {"label"=x[1], "start"=i, "end"=i}

    
    
    
def list_to_prodigy(x, i):
    return {"label": x[1], "start": i, "end": i}
    
def list_to_prodigy(x, i):
    x = x.split("\t")
    return {"label"=x[1], "start"=i, "end"=i}
def list_to_prodigy(x, i):
    x = x.split("\t")
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(i) for i in example.split("\n")]
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
example
example.split("\n")
def list_to_prodigy(x, i):
    x = x.split("\t")
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")[:-1]
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")[-1:]
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")[:-1]
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
[list_to_prodigy(x, i) for i, x in enumerate(example.split("\n"))]
def list_to_prodigy(x, i):
    x = x.split("\t")
    print(x)
    return {"label": x[1], "start": i, "end": i}
    
get_ipython().run_line_magic('save', '--help')
get_ipython().run_line_magic('save', 'help')
get_ipython().run_line_magic('save', '')
get_ipython().run_line_magic('save', '-a foo')
