class_docstr: An implementation for an explainable neural network for natural
  language processing and generating rationales used by that network.
  Based on the paper "Rethinking Cooperative Rationalization: Introspective
  Extraction and Complement Control" by Yu et. al.
docstr: Display a given example with important/rationale words
  displayed in brackets.
  
  :param x: tokenized embedded example
  :type x: torch tensor
  :param m: mask differentiating word from padding tokens
  :type m: torch tensor
  :param z: tensor indicating whether a word is part of the
      generated rationale
  :type z: torch tensor
  :return: (human-readable, word) tokens with words
      selected as part of the rationale indicated by brackets
  :rtype: string
docstr_tok: ["Display","a","given","example","with","important\/rationale","words","displayed","in","brackets",".",":","param","x",":","tokenized","embedded","example",":","type","x",":","torch","tensor",":","param","m",":","mask","differentiating","word","from","padding","tokens",":","type","m",":","torch","tensor",":","param","z",":","tensor","indicating","whether","a","word","is","part","of","the","generated","rationale",":","type","z",":","torch","tensor",":","return",":","(","human-readable",",","word",")","tokens","with","words","selected","as","part","of","the","rationale","indicated","by","brackets",":","rtype",":","string"]
code: def display_example(self, x, m, z):
      """Display a given example with important/rationale words
      displayed in brackets.
  
      :param x: tokenized embedded example
      :type x: torch tensor
      :param m: mask differentiating word from padding tokens
      :type m: torch tensor
      :param z: tensor indicating whether a word is part of the
          generated rationale
      :type z: torch tensor
      :return: (human-readable, word) tokens with words
          selected as part of the rationale indicated by brackets
      :rtype: string
      """
      seq_len = int(m.sum().item())
      ids = x[:seq_len]
      tokens = self.preprocessor.decode_single(ids)
  
      final = ""
      for i in range(len(tokens)):
          if z[i]:
              final += "[" + tokens[i] + "]"
          else:
              final += tokens[i]
          final += " "
      return final
  
imports: import logging
  import os
  import random
  from collections import deque
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from interpret_text.experimental.common.base_text_model import BaseTextModel
  from torch.autograd import Variable
  from tqdm import tqdm
  from interpret_text.experimental.common.utils_introspective_rationale import generate_data
label_desc: Use image node_id 13 for calling the IntrospectiveRationaleModel obj's underlying member method code with example usage: obj.display_example(x, m, z) and returns: final