New function to get English label for entity
This commit is contained in:
parent
6a6b5ad373
commit
f322a6f47f
|
@ -9,3 +9,7 @@ def get_entity_label(entity):
|
||||||
label_values = {l['value'] for l in entity['labels'].values()}
|
label_values = {l['value'] for l in entity['labels'].values()}
|
||||||
if len(label_values) == 1:
|
if len(label_values) == 1:
|
||||||
return list(label_values)[0]
|
return list(label_values)[0]
|
||||||
|
|
||||||
|
def get_en_label(entity):
|
||||||
|
if 'en' in entity['labels']:
|
||||||
|
return entity['labels']['en']['value']
|
||||||
|
|
Loading…
Reference in a new issue