docstr: Uses the metadata returned by the anchor search algorithm together with
  the instance to be explained to build an explanation object.
  
  Parameters
  ----------
  text
      Instance to be explained.
  result
      Dictionary containing the search result and metadata.
  predicted_label
      Label of the instance to be explained. Inferred if not received.
  params
      Arguments passed to `explain`.
docstr_tok: ["Uses","the","metadata","returned","by","the","anchor","search","algorithm","together","with","the","instance","to","be","explained","to","build","an","explanation","object",".","Parameters","--","--","--","--","--","text","Instance","to","be","explained",".","result","Dictionary","containing","the","search","result","and","metadata",".","predicted_label","Label","of","the","instance","to","be","explained",".","Inferred","if","not","received",".","params","Arguments","passed","to","`","explain","`","."]
code: def _build_explanation(
      self, text: str, result: dict, predicted_label: int, params: dict
  ) -> Explanation:
      """
      Uses the metadata returned by the anchor search algorithm together with
      the instance to be explained to build an explanation object.
  
      Parameters
      ----------
      text
          Instance to be explained.
      result
          Dictionary containing the search result and metadata.
      predicted_label
          Label of the instance to be explained. Inferred if not received.
      params
          Arguments passed to `explain`.
      """
  
      result["instance"] = text
      result["instances"] = [text]  # TODO: should this be an array?
      result["prediction"] = np.array([predicted_label])
      exp = AnchorExplanation("text", result)
  
      # output explanation dictionary
      data = copy.deepcopy(DEFAULT_DATA_ANCHOR)
      data.update(
          anchor=exp.names(),
          precision=exp.precision(),
          coverage=exp.coverage(),
          raw=exp.exp_map,
      )
  
      # create explanation object
      explanation = Explanation(
          meta=copy.deepcopy(self.meta), data=data
      )
  
      # params passed to explain
      # explanation.meta['params'].update(params)
      return explanation
  
imports: import copy
  import logging
  import string
  from copy import deepcopy
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import spacy
  from alibi.utils.missing_optional_dependency import import_optional
  from alibi.api.defaults import DEFAULT_DATA_ANCHOR, DEFAULT_META_ANCHOR
  from alibi.api.interfaces import Explainer, Explanation
  from alibi.exceptions import PredictorCallError, PredictorReturnTypeError
  from alibi.utils.wrappers import ArgmaxTransformer
  from .anchor_base import AnchorBaseBeam
  from .anchor_explanation import AnchorExplanation
  from .text_samplers import UnknownSampler, SimilaritySampler, load_spacy_lexeme_prob
label_desc: Use image node_id 6 for calling the AnchorText obj's underlying member method code with example usage: obj._build_explanation(text, result, predicted_label, params) and returns: explanation