Browse Source

Merge pull request #1955 from doccano/fix/fileContentOfRelationExtraction

Fix the example file content for relation extraction
pull/1959/head
Hiroki Nakayama 2 years ago
committed by GitHub
parent
commit
56c37bd868
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 46 deletions
  1. 47
      backend/data_import/pipeline/examples/relation_extraction/example.jsonl
  2. 6
      frontend/pages/projects/_id/dataset/import.vue

47
backend/data_import/pipeline/examples/relation_extraction/example.jsonl

@ -1,46 +1 @@
{
"text": "Google was founded on September 4, 1998, by Larry Page and Sergey Brin.",
"entities": [
{
"id": 0,
"start_offset": 0,
"end_offset": 6,
"label": "ORG"
},
{
"id": 1,
"start_offset": 22,
"end_offset": 39,
"label": "DATE"
},
{
"id": 2,
"start_offset": 44,
"end_offset": 54,
"label": "PERSON"
},
{
"id": 3,
"start_offset": 59,
"end_offset": 70,
"label": "PERSON"
}
],
"relations": [
{
"from_id": 0,
"to_id": 1,
"type": "foundedAt"
},
{
"from_id": 0,
"to_id": 2,
"type": "foundedBy"
},
{
"from_id": 0,
"to_id": 3,
"type": "foundedBy"
}
]
}
{"text":"Google was founded on September 4, 1998, by Larry Page and Sergey Brin.","entities":[{"id":0,"start_offset":0,"end_offset":6,"label":"ORG"},{"id":1,"start_offset":22,"end_offset":39,"label":"DATE"},{"id":2,"start_offset":44,"end_offset":54,"label":"PERSON"},{"id":3,"start_offset":59,"end_offset":70,"label":"PERSON"}],"relations":[{"from_id":0,"to_id":1,"type":"foundedAt"},{"from_id":0,"to_id":2,"type":"foundedBy"},{"from_id":0,"to_id":3,"type":"foundedBy"}]}

6
frontend/pages/projects/_id/dataset/import.vue

@ -47,6 +47,12 @@
>
<pre>{{ example }}</pre>
</v-sheet>
<div v-if="selected === 'JSONL(Relation)'">
<p class="body-1">For readability, the above format can be displayed as follows:</p>
<v-sheet :dark="!$vuetify.theme.dark" :light="$vuetify.theme.dark" class="mb-5 pa-5">
<pre>{{ JSON.stringify(JSON.parse(example.replaceAll("'", '"')), null, 4) }}</pre>
</v-sheet>
</div>
<file-pond
v-if="selected && acceptedFileTypes !== '*'"
ref="pond"

Loading…
Cancel
Save