How could I use the code below to go through a folder of documents and get each documents vector value, and then average the overall value?
documents_list = ['Hello, world','Here are two sentences.']
for doc in documents_list:
doc_nlp = nlp(doc)
print(doc_nlp.vector)
for token in doc_nlp:
print(token.text,token.vector)
I'm not sure what you mean by a document (I'm not familiar with spacy), but if you want the average, then you can just add each vector to a list, and then after the for loop, do: