(abstract, vocab, article_oovs)
return out_str
Returns the abstract string, highlighting the article OOVs with __underscores__.

  If a list of article_oovs is provided, non-article OOVs are differentiated like !!__this__!!.

  Args:
    abstract: string
    vocab: Vocabulary object
    article_oovs: list of words (strings), or None (in baseline mode)
Returns the abstract string, highlighting the article OOVs with __underscores__.
Returns the abstract string highlighting the article OOVs with __underscores__ .
def show_abs_oovs(abstract, vocab, article_oovs):
  """Returns the abstract string, highlighting the article OOVs with __underscores__.

  If a list of article_oovs is provided, non-article OOVs are differentiated like !!__this__!!.

  Args:
    abstract: string
    vocab: Vocabulary object
    article_oovs: list of words (strings), or None (in baseline mode)
  """
  unk_token = vocab.word2id(UNKNOWN_TOKEN)
  words = abstract.split(' ')
  new_words = []
  for w in words:
    if vocab.word2id(w) == unk_token: # w is oov
      if article_oovs is None: # baseline mode
        new_words.append("__%s__" % w)
      else: # pointer-generator mode
        if w in article_oovs:
          new_words.append("__%s__" % w)
        else:
          new_words.append("!!__%s__!!" % w)
    else: # w is in-vocab word
      new_words.append(w)
  out_str = ' '.join(new_words)
  return out_str
def show_abs_oovs ( abstract , vocab , article_oovs ) : unk_token = vocab . word2id ( UNKNOWN_TOKEN ) words = abstract . split ( ' ' ) new_words = [ ] for w in words : if vocab . word2id ( w ) == unk_token : # w is oov if article_oovs is None : # baseline mode new_words . append ( "__%s__" % w ) else : # pointer-generator mode if w in article_oovs : new_words . append ( "__%s__" % w ) else : new_words . append ( "!!__%s__!!" % w ) else : # w is in-vocab word new_words . append ( w ) out_str = ' ' . join ( new_words ) return out_str