コード例 #1
0
 def _get_annotation_key(self, result):
     result_type = result.get('type')
     if result_type in ('relation', 'rating', 'pairwise'):
         return None
     if 'from_name' not in result or 'to_name' not in result:
         logger.error(
             'Unexpected annotation.result format: "from_name" or "to_name" not found in %r' % result)
         return None
     result_from_name = result['from_name']
     key = get_annotation_tuple(result_from_name, result['to_name'], result_type or '')
     return key
コード例 #2
0
ファイル: models.py プロジェクト: stjordanis/label-studio
 def _get_annotation_key(self, result):
     result_type = result.get('type', None)
     if result_type in ('relation', 'pairwise', None):
         return None
     if 'from_name' not in result or 'to_name' not in result:
         logger.error(
             'Unexpected annotation.result format: "from_name" or "to_name" not found in %r',
             result,
             extra={'sentry_skip': True},
         )
         return None
     result_from_name = result['from_name']
     key = get_annotation_tuple(result_from_name, result['to_name'], result_type or '')
     return key