<SYSTEM_TASK:>
Given the following text problem statement, write Python code to implement the functionality described below in problem statement
<END_TASK>
<USER_TASK:>
Problem:
My goal is to input 3 queries and find out which query is most similar to a set of 5 documents.
<ASSISTANT_TASK:>
Python Code:
import numpy as np
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
queries, documents = load_data()
assert type(queries) == list
assert type(documents) == list
tfidf = TfidfVectorizer()
tfidf.fit_transform(documents)
from sklearn.metrics.pairwise import cosine_similarity
cosine_similarities_of_queries = []
for query in queries:
    query_tfidf = tfidf.transform([query])
    cosine_similarities_of_queries.append(cosine_similarity(query_tfidf, tfidf.transform(documents)).flatten())
<END_TASK>