Skip to content

Commit

Permalink
Merge pull request #39 from impresso/31-revise-entity-json-schema
Browse files Browse the repository at this point in the history
31 revise entity json schema
  • Loading branch information
EmanuelaBoros authored Nov 15, 2024
2 parents ec5e806 + cb963f2 commit 7611db1
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 81 deletions.
25 changes: 15 additions & 10 deletions examples/entities/example0.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
{
"id": "EXP-1888-01-09-a-i0035",
"ci_id": "EXP-1888-01-09-a-i0035",
"ts": "2019-10-17T11:49:50Z",
"sys_id": "bert-fr",
"model_id": "bert-fr",
"nes": [
{
"type": "org.adm",
"surface": "Société suisse du Grutli",
"lOffset": 32,
"rOffset": 56,
"id": "EXP-1888-01-09-a-i0035:32:56:org.adm:bert-fr",
"name": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"name": "Société suisse du Grutli",
"wkd_id": "Q683672",
"wkpedia_pagename": "Société_du_Grütli",
"confidence": "medium"
"wkpedia_url": "https://fr.wikipedia.org/wiki/Soci%C3%A9t%C3%A9_du_Gr%C3%BCtli",
"confidence_ner": 50.45,
"confidence_nel": 50.45,
"id": "EXP-1888-01-09-a-i0035:32:56:org.adm:bert-fr"
},
{
"type": "pers.ind",
"surface": "Bovat, mécanicien à Echallens",
"surface": "Mr. Bovat, mécanicien à Echallens",
"lOffset": 156,
"rOffset": 178,
"id": "EXP-1888-01-09-a-i0035:156:178:pers.ind:bert-fr",
"name": "EXP-1888-01-09-a-i0035:156:178:pers.ind:bert-fr",
"function": "mécanicien à Echallens",
"wkd_id": "NIL",
"wkpedia_pagename": "NIL",
"confidence": "high"
"wkpedia_url": "N/A",
"confidence_ner": 50.45,
"confidence_nel": 50.45,
"name": "Bovat",
"title": "Mr.",
"function": "mécanicien à Echallens",
"id": "EXP-1888-01-09-a-i0035:156:178:pers.ind:bert-fr"
}
]
}
Expand Down
16 changes: 10 additions & 6 deletions examples/entities/example1.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
{
"id": "EXP-1928-05-15-a-i0009",
"ci_id": "EXP-1928-05-15-a-i0009",
"ts": "2019-10-17T11:49:50Z",
"sys_id": "bert-fr",
"model_id": "bert-fr",
"nes": [
{
"id": "EXP-1928-05-15-a-i0009:50:99:pers.ind:bert-fr",
"type": "pers.ind",
"surface": "M. Wou, ancien ministre du gouvernement cantonais",
"lOffset": 50,
"rOffset": 99,
"id": "EXP-1928-05-15-a-i0009:50:99:loc.adm.nat:bert-fr",
"name": "Wou",
"title": "M.",
"function": "ancien ministre du gouvernement cantonais",
"wkd_id": "NIL",
"wkpedia_pagename": "NIL",
"confidence": "medium"
"wkpedia_url": "N/A",
"confidence_ner": 50.45,
"confidence_nel": 50.45
},
{
"id": "EXP-1888-01-09-a-i0035:32:42:loc.adm.nat:bert-fr",
"type": "loc.adm.nat",
"surface": "Etats-Unis",
"lOffset": 32,
"rOffset": 42,
"id": "EXP-1888-01-09-a-i0035:32:42:loc.adm.nat:bert-fr",
"wkd_id": "Q30",
"wkpedia_pagename": "États-Unis",
"confidence": "medium"
"wkpedia_url": "https://fr.wikipedia.org/wiki/%C3%89tats-Unis",
"confidence_ner": 50.45,
"confidence_nel": 50.45
}
]
}
20 changes: 12 additions & 8 deletions examples/entities/example2.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
{
"id": "EXP-1968-02-23-a-i0262",
"ci_id": "EXP-1968-02-23-a-i0262",
"ts": "2019-10-17T11:49:50Z",
"sys_id": "bert-fr",
"model_id": "bert-fr",
"nes": [
{
"type": "pers.ind",
"surface": "championne de France de ski nautique, Sylvie Maurial",
"lOffset": 50,
"rOffset": 102,
"id": "EXP-1968-02-23-a-i0262:50:102:loc.adm.nat:bert-fr",
"confidence_ner": 50.45,
"confidence_nel": 50.45,
"wkd_id": "Q20993704",
"wkpedia_pagename": "Sylvie_Maurial",
"wkpedia_url": "https://fr.wikipedia.org/wiki/Sylvie_Maurial",
"name": "Sylvie Maurial",
"function": "championne de France de ski nautique",
"wkd_id": "Q20993704",
"wkpedia_pagename": "Sylvie_Maurial"
"id": "EXP-1968-02-23-a-i0262:50:102:pers.ind:bert-fr"
},
{
"type": "loc.adm.nat",
"surface": "France",
"lOffset": 64,
"rOffset": 70,
"id": "EXP-1888-01-09-a-i0035:64:70:loc.adm.nat:bert-fr",
"nested": true,
"wkd_id": "Q20993704",
"wkpedia_pagename": "France",
"confidence": "medium"
"wkpedia_url": "https://fr.wikipedia.org/wiki/France",
"confidence_ner": 50.45,
"confidence_nel": 50.45,
"id": "EXP-1888-01-09-a-i0035:64:70:loc.adm.nat:bert-fr"
}
]
}
Expand Down
144 changes: 144 additions & 0 deletions json/entities/entities-backup.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://impresso.github.io/impresso-schemas/json/entities.schema.json",
"title": "Named Entity JSON Schema",
"description": "Definition of the output representation of entity processing, before indexing. Named entity mentions are expressed as offline annotations with character offsets relative to content items. Essentially, the NE output is a list of JSON documents (in json line format), where each document corresponds to a content item that has a list of NE mentions (no output for CI with no mentions). The tagset corresponds to impresso-HIPE.",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "impresso content item id."
},
"ts": {
"type": "string",
"description": "Timestamp of creation of the JSON file (e.g. '2018-09-18T08:00:08Z')"
},
"sys_id": {
"type": "string",
"description": "An alias for the system or model that produced this output (preferably short, but still understandable), used for transparency and traceability. Should be unique and thus include elements that distinguish one model from another, such as a base name, a version, the language, e.g. bert-xxxx-xxxx-fr."
},
"nes": {
"type": "array",
"description": "The list of named entity mentions identified in the document",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description":"NE type",
"enum": [
"building",
"loc",
"loc.add",
"loc.add.elec",
"loc.add.phys",
"loc.adm",
"loc.adm.nat",
"loc.adm.reg",
"loc.adm.sup",
"loc.adm.town",
"loc.admin.sup",
"loc.fac",
"loc.oro",
"loc.phys",
"loc.phys.astro",
"loc.phys.geo",
"loc.phys.hydro",
"loc.unk",
"org",
"org.adm",
"org.ent",
"org.ent.pressagency",
"per",
"per.author",
"pers",
"pers.coll",
"pers.ind",
"pers.ind.articleauthor",
"prod",
"prod.doctr",
"prod.media",
"street",
"time",
"time.date.abs"
]
},
"surface": {
"type": "string",
"description":"The (string) surface of the named entity mention, as it appears in the text"
},
"name": {
"type": "string",
"description":"In case of a person mention, the entity component of type name."
},
"lOffset": {
"type": "integer",
"description":"The left character offset of the named entity with respect to the content item, as in the rebuilt format."
},
"rOffset": {
"type": "integer",
"description":"The right character offset of the named entity with respect to the content item, as in the rebuilt format."
},
"firstname": {
"type": "string",
"description":"In case of a person mention and if available, the first name."
},
"surname": {
"type": "string",
"description":"In case of a person mention and if available, the surname."
},
"title": {
"type": "string",
"description":"In case of a person mention, the entity component of type 'title'."
},
"function": {
"type": "string",
"description":"In case of a person mention, the entity component of type 'function'."
},
"demonym": {
"type": "string",
"description":"In case of a person mention, the entity component of type 'demonym'."
},
"nested": {
"type": "boolean",
"description":"In case of a nested mention, this property should be set to true. Can be ignored if not."
},
"wkd_id": {
"type": "string",
"description":"If exists, wikidata QID"
},
"wkpedia_pagename": {
"type": "string",
"description":"If exists, wikipedia page name or, if not possible, wikipedia URL, in the language the NE recognition is made (e.g. page name 'Etats-Unis' if EL performed against French wikipedia, and 'United_States' is against English Wikipedia. "
},
"confidence": {
"type": "string",
"enum": [
"low",
"medium",
"high"
]
},
"id": {
"type": "string",
"description":"The id of the named entity mention composed of the following set of values concatenated with a colon (':') : content item id + loffset + roffset + type + sys_id (e.g. 'LLE-1989-04-04-a-i0195:56:69:person:bert-xxxx-xxxx-fr'."
}
},
"required": [
"type",
"surface",
"lOffset",
"rOffset",
"id"
]
}
}
},
"required": [
"id",
"ts",
"sys_id",
"nes"
]
}
Loading

0 comments on commit 7611db1

Please sign in to comment.