input: def email_spam_classifier(dataset_path: str) -> float:
      """
      Create an AI model in Python to classify emails from the dataset as either spam or non-spam.
      The program loads the dataset, performs a train-test split, and trains an SVM model with a bag of words model.
      It then tests the model and returns the precision score of the classifier.
      
      >>> email_spam_classifier("spam.csv")
      0.94
      """
output:     
      import pandas as pd
      from sklearn.model_selection import train_test_split
      from sklearn.feature_extraction.text import CountVectorizer
      from sklearn.svm import SVC
      from sklearn.metrics import precision_score
  
      # Load the dataset
      df = pd.read_csv(dataset_path, encoding='latin-1')
      df = df[['v1', 'v2']]
      df.columns = ['label', 'text']
  
      # Convert labels to binary
      df['label'] = df['label'].map({'ham': 0, 'spam': 1})
  
      # Split the dataset into training and testing sets
      X_train, X_test, y_train, y_test = train_test_split(df['text'], df['label'], test_size=0.2, random_state=42)
  
      # Create a bag of words model
      vectorizer = CountVectorizer()
      X_train_vec = vectorizer.fit_transform(X_train)
      X_test_vec = vectorizer.transform(X_test)
  
      # Train an SVM model
      svm_model = SVC(kernel='linear')
      svm_model.fit(X_train_vec, y_train)
  
      # Predict on the test set
      y_pred = svm_model.predict(X_test_vec)
  
      # Calculate precision score
      precision = precision_score(y_test, y_pred)
  
      return precision
  