input: Write a python function to extract named entities from a given sentence using NLTK.
  assert extract_named_entities("The founder of Apple Steve Jobs passed away.") == ["Apple", "Steve Jobs"]
  assert extract_named_entities("Barack Obama was born in Hawaii.") == ["Barack Obama", "Hawaii"]
  assert extract_named_entities("Microsoft was founded by Bill Gates and Paul Allen.") == ["Microsoft", "Bill Gates", "Paul Allen"]
output: def extract_named_entities(sentence):
      import nltk
      from nltk import word_tokenize, pos_tag, ne_chunk
  
      # Ensure you have the necessary NLTK data files
      nltk.download('punkt')
      nltk.download('maxent_ne_chunker')
      nltk.download('words')
      nltk.download('averaged_perceptron_tagger')
  
      # Tokenize the sentence
      words = word_tokenize(sentence)
      # POS tagging
      pos_tags = pos_tag(words)
      # Named entity chunking
      chunks = ne_chunk(pos_tags)
  
      # Extract named entities
      named_entities = []
      current_chunk = []
      
      for chunk in chunks:
          if hasattr(chunk, 'label'):
              if chunk.label() in ['PERSON', 'ORGANIZATION', 'GPE']:
                  current_chunk.append(' '.join(c[0] for c in chunk))
          else:
              if current_chunk:
                  named_entities.append(' '.join(current_chunk))
                  current_chunk = []
      if current_chunk:
          named_entities.append(' '.join(current_chunk))
      
      return named_entities