MCPcopy Create free account
hub / github.com/PAIR-code/lit / remap

Method remap

lit_nlp/api/dataset.py:235–239  ·  view source on GitHub ↗

Return a copy of this dataset with some fields renamed.

(self, field_map: Mapping[str, str])

Source from the content-addressed store, hash-verified

233 return self.sample(n=len(self), seed=seed)
234
235 def remap(self, field_map: Mapping[str, str]):
236 """Return a copy of this dataset with some fields renamed."""
237 new_spec = utils.remap_dict(self.spec(), field_map)
238 new_examples = [utils.remap_dict(ex, field_map) for ex in self.examples]
239 return Dataset(new_spec, new_examples, base=self)
240
241 @staticmethod
242 def lit_example_from_bytes(input_bytes: bytes) -> Optional[JsonDict]:

Callers 2

annotateMethod · 0.95
test_remapMethod · 0.95

Calls 2

specMethod · 0.95
DatasetClass · 0.85

Tested by 1

test_remapMethod · 0.76