input: Write a function to create a machine learning classifier in Python for categorizing user input using a Multinomial Naive Bayes model. The function should accept an input string, perform feature extraction and transformation, train the classifier on the data, and return the prediction.
  def classify_string(input_string):
    features = . . .
    model = MultinomialNB()
    model.fit(data, target)
    prediction = model.predict([features])
    return prediction
  assert classify_string("hello world")=="greeting"
  assert classify_string("how are you?")=="inquiry"
  assert classify_string("buy now")=="advertisement"
  assert classify_string("goodbye")=="farewell"
  assert classify_string("unknown input")=="unknown"
output: def classify_string(input_string):
    from sklearn.feature_extraction.text import CountVectorizer
    from sklearn.naive_bayes import MultinomialNB
    data = ["hello world", "how are you?", "buy now", "goodbye", "unknown input"]
    target = ["greeting", "inquiry", "advertisement", "farewell", "unknown"]
    vectorizer = CountVectorizer()
    X = vectorizer.fit_transform(data)
    features = vectorizer.transform([input_string])
    model = MultinomialNB()
    model.fit(X, target)
    prediction = model.predict(features)
    return prediction[0]