Skip to content

Instantly share code, notes, and snippets.

@zredlined
Created March 13, 2020 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zredlined/2840f74b1d7b7d05880a3a77c67c5ad8 to your computer and use it in GitHub Desktop.
Save zredlined/2840f74b1d7b7d05880a3a77c67c5ad8 to your computer and use it in GitHub Desktop.
example ontonotes5 converted to spacy training format
{
"id": "fake",
"paragraphs": [
{
"raw": "Israel has blockaded all West Bank cities after 10 people died in one of the worst days of Israeli-Palestinian violence in more than 10 weeks. Israeli tank-fire killed five Palestinians including four policemen in the West Bank town of Jenine. Israeli forces killed one Palestinian near Bethlehem and another in Arab East Jerusalem. Palestinian gunmen in the West Bank killed two Jewish settlers in a roadside ambush near Hebron and a third Israeli in an attack against a bus outside of Jericho.",
"sentences": [
{
"tokens": [
{
"dep": "",
"head": 0,
"id": 0,
"ner": "U-GPE",
"orth": "Israel ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 1,
"ner": "O",
"orth": "has ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 2,
"ner": "O",
"orth": "blockaded ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 3,
"ner": "O",
"orth": "all ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 4,
"ner": "B-GPE",
"orth": "West ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 5,
"ner": "L-GPE",
"orth": "Bank ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 6,
"ner": "O",
"orth": "cities ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 7,
"ner": "O",
"orth": "after ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 8,
"ner": "U-CARDINAL",
"orth": "10 ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 9,
"ner": "O",
"orth": "people ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 10,
"ner": "O",
"orth": "died ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 11,
"ner": "O",
"orth": "in ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 12,
"ner": "U-CARDINAL",
"orth": "one ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 13,
"ner": "O",
"orth": "of ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 14,
"ner": "B-DATE",
"orth": "the ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 15,
"ner": "I-DATE",
"orth": "worst ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 16,
"ner": "L-DATE",
"orth": "days ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 17,
"ner": "O",
"orth": "of ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 18,
"ner": "U-NORP",
"orth": "Israeli ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 19,
"ner": "O",
"orth": "- ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 20,
"ner": "O",
"orth": "Palestinian ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 21,
"ner": "O",
"orth": "violence ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 22,
"ner": "O",
"orth": "in ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 23,
"ner": "B-DATE",
"orth": "more ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 24,
"ner": "I-DATE",
"orth": "than ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 25,
"ner": "I-DATE",
"orth": "10 ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 26,
"ner": "L-DATE",
"orth": "weeks ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 27,
"ner": "O",
"orth": ".",
"tag": ""
}
]
},
{
"tokens": [
{
"dep": "",
"head": 0,
"id": 0,
"ner": "U-NORP",
"orth": "Israeli ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 1,
"ner": "O",
"orth": "tank ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 2,
"ner": "O",
"orth": "- ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 3,
"ner": "O",
"orth": "fire ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 4,
"ner": "O",
"orth": "killed ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 5,
"ner": "U-CARDINAL",
"orth": "five ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 6,
"ner": "U-NORP",
"orth": "Palestinians ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 7,
"ner": "O",
"orth": "including ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 8,
"ner": "U-CARDINAL",
"orth": "four ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 9,
"ner": "O",
"orth": "policemen ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 10,
"ner": "O",
"orth": "in ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 11,
"ner": "O",
"orth": "the ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 12,
"ner": "B-GPE",
"orth": "West ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 13,
"ner": "L-GPE",
"orth": "Bank ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 14,
"ner": "O",
"orth": "town ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 15,
"ner": "O",
"orth": "of ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 16,
"ner": "U-GPE",
"orth": "Jenine ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 17,
"ner": "O",
"orth": ".",
"tag": ""
}
]
},
{
"tokens": [
{
"dep": "",
"head": 0,
"id": 0,
"ner": "U-NORP",
"orth": "Israeli ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 1,
"ner": "O",
"orth": "forces ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 2,
"ner": "O",
"orth": "killed ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 3,
"ner": "U-CARDINAL",
"orth": "one ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 4,
"ner": "U-NORP",
"orth": "Palestinian ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 5,
"ner": "O",
"orth": "near ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 6,
"ner": "U-GPE",
"orth": "Bethlehem ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 7,
"ner": "O",
"orth": "and ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 8,
"ner": "O",
"orth": "another ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 9,
"ner": "O",
"orth": "in ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 10,
"ner": "U-NORP",
"orth": "Arab ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 11,
"ner": "B-GPE",
"orth": "East ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 12,
"ner": "L-GPE",
"orth": "Jerusalem ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 13,
"ner": "O",
"orth": ".",
"tag": ""
}
]
},
{
"tokens": [
{
"dep": "",
"head": 0,
"id": 0,
"ner": "U-NORP",
"orth": "Palestinian ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 1,
"ner": "O",
"orth": "gunmen ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 2,
"ner": "O",
"orth": "in ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 3,
"ner": "B-GPE",
"orth": "the ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 4,
"ner": "I-GPE",
"orth": "West ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 5,
"ner": "L-GPE",
"orth": "Bank ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 6,
"ner": "O",
"orth": "killed ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 7,
"ner": "U-CARDINAL",
"orth": "two ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 8,
"ner": "U-NORP",
"orth": "Jewish ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 9,
"ner": "O",
"orth": "settlers ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 10,
"ner": "O",
"orth": "in ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 11,
"ner": "O",
"orth": "a ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 12,
"ner": "O",
"orth": "roadside ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 13,
"ner": "O",
"orth": "ambush ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 14,
"ner": "O",
"orth": "near ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 15,
"ner": "U-GPE",
"orth": "Hebron ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 16,
"ner": "O",
"orth": "and ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 17,
"ner": "O",
"orth": "a ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 18,
"ner": "O",
"orth": "third ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 19,
"ner": "U-NORP",
"orth": "Israeli ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 20,
"ner": "O",
"orth": "in ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 21,
"ner": "O",
"orth": "an ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 22,
"ner": "O",
"orth": "attack ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 23,
"ner": "O",
"orth": "against ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 24,
"ner": "O",
"orth": "a ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 25,
"ner": "O",
"orth": "bus ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 26,
"ner": "O",
"orth": "outside ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 27,
"ner": "O",
"orth": "of ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 28,
"ner": "U-GPE",
"orth": "Jericho ",
"tag": ""
},
{
"dep": "",
"head": 0,
"id": 29,
"ner": "O",
"orth": ".",
"tag": ""
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment