input: Write a python function to train a Gaussian Mixture Model using sklearn, and evaluate its accuracy on a given dataset. The dataset should be preprocessed to convert categorical text features into numerical values using LabelEncoder.
  assert round(train_gmm_model('data.csv'), 2) == 0.85
  assert round(train_gmm_model('another_data.csv'), 2) == 0.90
output: def train_gmm_model(file_path):
      import pandas as pd
      from sklearn.preprocessing import LabelEncoder
      from sklearn.mixture import GaussianMixture
      from sklearn.model_selection import train_test_split
      from sklearn.metrics import accuracy_score
  
      # Load dataset
      data = pd.read_csv(file_path)
  
      # Separate features and target
      X = data.iloc[:, :-1]
      y = data.iloc[:, -1]
  
      # Convert categorical features to numerical values using LabelEncoder
      label_encoders = {}
      for column in X.select_dtypes(include=['object']).columns:
          le = LabelEncoder()
          X[column] = le.fit_transform(X[column])
          label_encoders[column] = le
  
      # Split the data into training and testing sets
      X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
  
      # Fit Gaussian Mixture Model
      gmm = GaussianMixture(n_components=len(y.unique()), random_state=42)
      gmm.fit(X_train, y_train)
  
      # Predict the probabilities and get the most probable class
      y_pred = gmm.predict(X_test)
  
      # Evaluate accuracy
      accuracy = accuracy_score(y_test, y_pred)
  
      return accuracy