def METHOD_NAME(self, input_data: Union[np.ndarray, List[str]]) -> np.ndarray:
    # The contract is that alibi-explain would input/output ndarray
    # in the case of AnchorText, we have a list of strings instead though.
    # TODO: for now we only support v2 protocol, do we need more support?
    if self.infer_metadata is None and self.infer_uri.find("/v2/pipelines/") == -1:
        meta_url = construct_metadata_url(self.infer_uri)
        # get the metadata of the underlying inference model via v2
        # metadata endpoint
        self.infer_metadata = remote_metadata(
            meta_url, ssl_verify_path=self.ssl_verify_path
        )
    v2_request = to_v2_inference_request(
        input_data=input_data,
        metadata=self.infer_metadata,
        output=self.alibi_explain_settings.infer_output,
    )
    v2_response = remote_predict(
        v2_payload=v2_request,
        predictor_url=self.infer_uri,
        ssl_verify_path=self.ssl_verify_path,
    )
    # TODO: do we care about more than one output?
    decoded = NumpyCodec.decode_output(v2_response.outputs[0])
    if decoded.ndim > 1 and decoded.shape[-1] == 1:
        # Assume the response tensor is shaped as `[N, 1]` and remove the
        # explicit dimensionality shape (which Alibi doesn't seem to like)
        last_dim = decoded.ndim - 1
        return decoded.squeeze(axis=last_dim)
    return decoded