input: 
  from sklearn.naive_bayes import MultinomialNB
  
  def classify_string(input_string):
      """Given a string input, this function extracts features from the string, 
      trains a Naive Bayes classifier, and returns the category predicted for the input string.
      >>> classify_string("Hello world")
      ['Greeting']
      >>> classify_string("How are you?")
      ['Question']
      """
      # Feature extraction and transformation from string to numeric
      features = ...
      
      # Create an instance of the classifier 
      model = MultinomialNB()
      
      # Train the classifier on the data
      model.fit(data, target)
      
      # Make a prediction based on the input
      prediction = model.predict([features])
      
      # Return the prediction
      return prediction
  
output:     from sklearn.feature_extraction.text import CountVectorizer
      from sklearn.model_selection import train_test_split
      import numpy as np
  
      # Sample data
      data = ["Hello world", "How are you?", "Good morning", "What's up?", "Hi there"]
      target = ["Greeting", "Question", "Greeting", "Question", "Greeting"]
  
      # Feature extraction
      vectorizer = CountVectorizer()
      X = vectorizer.fit_transform(data)
  
      # Split data for training
      X_train, _, y_train, _ = train_test_split(X, target, test_size=0.2, random_state=42)
  
      # Train the classifier
      model.fit(X_train, y_train)
  
      # Transform input string to features
      features = vectorizer.transform([input_string])
  
      # Make a prediction
      prediction = model.predict(features)
  
      return prediction