input: Write a python function to classify movie reviews as positive or negative using a trained logistic regression model within a pipeline, and return the sentiment score.
  assert round(sentiment('I loved the movie!'), 2) > 0.5
  assert round(sentiment('I hated the movie!'), 2) < 0.5
  assert round(sentiment('It was an amazing experience!'), 2) > 0.5
output: def sentiment(review):
      from sklearn.pipeline import Pipeline
      from sklearn.feature_extraction.text import TfidfVectorizer
      from sklearn.linear_model import LogisticRegression
      import numpy as np
  
      # Sample trained logistic regression model and pipeline (for demonstration purposes)
      pipeline = Pipeline([
          ('tfidf', TfidfVectorizer()),
          ('clf', LogisticRegression())
      ])
  
      # Sample training data (for demonstration purposes)
      X_train = [
          'I loved the movie!',
          'I hated the movie!',
          'It was an amazing experience!',
          'It was a terrible experience!',
          'The movie was great!',
          'The movie was awful!'
      ]
      y_train = [1, 0, 1, 0, 1, 0]  # 1 for positive, 0 for negative
  
      # Train the model
      pipeline.fit(X_train, y_train)
  
      # Predict sentiment score
      sentiment_score = pipeline.predict_proba([review])[0][1]
      
      return sentiment_score