input: Write a function to develop a machine learning model in Python to identify the author of a given article using a pipeline that includes TF-IDF vectorization and Gaussian Naive Bayes classification. If the model is trained successfully, it should return the accuracy score of the model on test data. If the input data is invalid or the model fails to train, return -1.
  from sklearn.feature_extraction.text import TfidfVectorizer
  from sklearn.naive_bayes import GaussianNB
  from sklearn.pipeline import Pipeline
  from sklearn.model_selection import train_test_split
  
  assert identify_author([
      "sample 1 from AuthorA",
      "sample 2 from AuthorA",
      "sample 1 from AuthorB",
      "sample 2 from AuthorB"
  ], [
      "AuthorA",
      "AuthorA",
      "AuthorB",
      "AuthorB"
  ]) > 0
  assert identify_author([], []) == -1
  assert identify_author(["sample 1"], []) == -1
  assert identify_author([], ["AuthorA"]) == -1
output: def identify_author(articles, authors):
      if not articles or not authors or len(articles) != len(authors):
          return -1
      
      X_train, X_test, y_train, y_test = train_test_split(articles, authors, test_size=0.2, random_state=42)
      
      try:
          pipeline = Pipeline([
              ('tfidf', TfidfVectorizer()),
              ('clf', GaussianNB())
          ])
          
          pipeline.fit(X_train, y_train)
          accuracy = pipeline.score(X_test, y_test)
          return accuracy
      except:
          return -1