class_docstr: Transforms the input sentence by adding a subordinate clause from WikiData.
  
  Example::
      original: "And it left mixed signals for London."
      transformed: "And it left mixed signals for London, which is a capital
          and largest city of the United Kingdom."
class_docstr_tok: ["Transforms","the","input","sentence","by","adding","a","subordinate","clause","from","WikiData",".","Example",":",":","original",":","``","And","it","left","mixed","signals","for","London",".","''","transformed",":","``","And","it","left","mixed","signals","for","London",",","which","is","a","capital","and","largest","city","of","the","United","Kingdom",".","''"]
docstr: Find an entity in the sentence.
  
  :param ~DPSample sample:
  :return: A list of entities, long to short.
docstr_tok: ["Find","an","entity","in","the","sentence",".",":","param","~DPSample","sample",":",":","return",":","A","list","of","entities",",","long","to","short","."]
code: def find_entity(self, sample):
      r"""
      Find an entity in the sentence.
  
      :param ~DPSample sample:
      :return: A list of entities, long to short.
  
      """
      brackets = sample.brackets
      words = sample.get_words("x")
      postags = sample.get_value("postag")
  
      nnp_list = []
      for i, postag in enumerate(postags):
          if postag in ("NNP", "NNPS"):
              nnp_list.append(i + 1)
  
      entity_list = []
      if nnp_list:
          entity_list.append([nnp_list[0]])
          nnp_list.pop(0)
          for word in nnp_list:
              if word == entity_list[-1][-1] + 1:
                  entity_list[-1].append(word)
              else:
                  entity_list.append([word])
          self.exclude_inside_brackets(entity_list, brackets)
          self.exclude_followed(entity_list, words, postags)
          self.combine_entities(entity_list, words)
  
      return sorted(entity_list, key=len, reverse=True)
  
file_path: textflint/textflint/generation/transformation/DP/add_sub_tree.py
imports: import json
  import random
  import urllib.request
  from wikidata.client import Client
  from wikidata.entity import Entity, EntityId
  from ..transformation import Transformation
  from ....common.utils.error import FlintError
  from ....common.settings import WIKIDATA_STATEMENTS, CLAUSE_HEAD, WIKIDATA_INSTANCE
label_desc: Use image node_id 7 for calling the AddSubTree obj's underlying member method code with example usage: obj.find_entity(sample) and returns: sorted