NamedScoreMappingis one of the primitive data type in Jina.
It offers a Pythonic interface to allow users access and manipulate
jina.jina_pb2.NamedScoreMappingProtoobject without working with Protobuf itself.
It offers an interface to access and update scores as NamedScore as values of a dict with a string key.
To create a
from jina.types.score.map import NamedScoreMapping scores = NamedScoreMapping() scores['score'] = 50
NamedScoreMappingcan be built from
jina_pb2.NamedScoreMappingProto(as a weak reference or a deep copy)
scores (MessageMapContainer) – The scores to construct from, depending on the
copy, it builds a view or a copy from it.
copy (bool) – When
scoresis given as a
NamedScoreMappingProtoobject, build a view (i.e. weak reference) from it or a deep copy from it.
kwargs – Other parameters to be set