title: how to remove the word which is not the name of person
body: <p>I want to get the name of person from text file  i use the nltk it returns name as well as the word which is not name:</p>
  
  <pre><code>def extract_names(text):
      tokens = nltk.tokenize.word_tokenize(text)
      pos = pos_tag(tokens)
      sentt = ne_chunk(pos, binary = False)
      person_list = []
      person = []
      name = ""
      for subtree in sentt.subtrees(filter=lambda t: t.label() == 'PERSON'):
          for leaf in subtree.leaves():
              person.append(leaf[0])
          if len(person) &gt; 1: #avoid grabbing lone surnames
              for part in person:
                  name += part + ' '
              name = remove_useless_name(name)
              if name[:-1] not in person_list:
                  person_list.append(name[:-1])
              name = ''
          person = []
  
      return person_list
  </code></pre>
  
  <p>i want to remove that word which is not name which method should i use for removing the word.
  Input like </p>
  
  <pre><code>"Sunder Pichai"
  "View Profile"
  "Risk Management"
  </code></pre>
  
  <p>sample output:</p>
  
  <pre><code>"Sunder Pichai"
  </code></pre>