Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_glue_text_preprocessor(builder_config):
"""Return the glue preprocessor.
Args:
builder_config: a BuilderConfig
Returns:
a preprocessor function
"""
# stsb uses a floating point target, so use special preprocessor
if builder_config.name == "stsb":
return preprocessors.stsb
elif builder_config.name == "wsc.fixed":
return preprocessors.wsc
elif builder_config.name == "record":
return preprocessors.record
else:
if "mnli" in builder_config.name or builder_config.name == "ax":
# Cast the GLUE diagnostic task as MNLI.
benchmark_name = "mnli"
elif builder_config.name in ["axb", "axg"]:
# Cast the SuperGLUE diagnostic tasks as RTE.
benchmark_name = "rte"
else:
benchmark_name = builder_config.name
if builder_config.name == "multirc":
feature_names = ("question", "answer", "paragraph")
elif builder_config.name == "wic":
# This ignores the start/end indices which show where in each sentence the
# word appears.
# TODO(craffel): Investigate using those indices.
feature_names = ("sentence1", "sentence2", "word")