input: Write a python function to perform logistic regression on a given text dataset and calculate the accuracy.
  assert logistic_regression_accuracy('text_data.npy', 'text_labels.npy') > 0.7
  assert logistic_regression_accuracy('sample_text_data.npy', 'sample_text_labels.npy') < 1.0
output: def logistic_regression_accuracy(data_path, labels_path):
      import numpy as np
      from sklearn.feature_extraction.text import TfidfVectorizer
      from sklearn.linear_model import LogisticRegression
      from sklearn.metrics import accuracy_score
  
      # Load the dataset
      text_data = np.load(data_path, allow_pickle=True)
      text_labels = np.load(labels_path, allow_pickle=True)
  
      # Convert text data to TF-IDF features
      vectorizer = TfidfVectorizer()
      X = vectorizer.fit_transform(text_data)
  
      # Initialize Logistic Regression model
      model = LogisticRegression(max_iter=1000)
  
      # Split the data into training and test sets
      split_index = int(0.8 * len(X))
      X_train, X_test = X[:split_index], X[split_index:]
      y_train, y_test = text_labels[:split_index], text_labels[split_index:]
  
      # Train the model
      model.fit(X_train, y_train)
  
      # Make predictions
      y_pred = model.predict(X_test)
  
      # Calculate accuracy
      accuracy = accuracy_score(y_test, y_pred)
  
      return accuracy