You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related documentation: :ref:`Key Value Extraction metric in catalog <catalog.metrics.key_value_extraction>`,:ref:`Templates tutorial <adding_template>`,
109
+
Related documentation: :ref:`Key Value Extraction metric in catalog <catalog.metrics.key_value_extraction>`,:ref:`Templates tutorial <adding_template>`
110
110
111
111
Evaluate using Unitxt metrics on existing predictions
Notice how the value of field ``"a"`` in the first instance is replaced with ``"hi"`` and the value of field ``"a"`` in the second instance is removed.
341
+
"""
327
342
key: str
328
343
map_values: dict
329
344
remove_values: Optional[list] =None
@@ -605,10 +620,27 @@ class AddConstant(FieldOperator):
605
620
defprocess_value(self, value: Any) ->Any:
606
621
returnself.add+value
607
622
608
-
609
623
classShuffleFieldValues(FieldOperator):
610
-
"""Shuffles a list of values found in a field."""
624
+
# Assisted by watsonx Code Assistant
625
+
"""An operator that shuffles the values of a list field.
626
+
627
+
the seed for shuffling in the is determined by the elements of the input field,
628
+
ensuring that the shuffling operation produces different results for different input lists,
629
+
but also that it is deterministic and reproducible.
630
+
631
+
Attributes:
632
+
None
611
633
634
+
Methods:
635
+
process_value(value: Any) -> Any:
636
+
Shuffles the elements of the input list and returns the shuffled list.
0 commit comments