Ich benutze Gensim Doc2Vec Modell, um meine Merkmalsvektoren zu generieren. Hier ist der Code, ich verwende (ich habe erklärt, was mein Problem in dem Code ist):Gensim Doc2Vec Modell erzeugt nur eine begrenzte Anzahl von Vektoren
cores = multiprocessing.cpu_count()
# creating a list of tagged documents
training_docs = []
# all_docs: a list of 53 strings which are my documents and are very long (not just a couple of sentences)
for index, doc in enumerate(all_docs):
# 'doc' is in unicode format and I have already preprocessed it
training_docs.append(TaggedDocument(doc.split(), str(index+1)))
# at this point, I have 53 strings in my 'training_docs' list
model = Doc2Vec(training_docs, size=400, window=8, min_count=1, workers=cores)
# now that I print the vectors, I only have 10 vectors while I should have 53 vectors for the 53 documents that I have in my training_docs list.
print(len(model.docvecs))
# output: 10
ich gerade fragen, wenn ich einen Fehler mache oder wenn es ein anderer Parameter, die ich gesetzt haben?
UPDATE: Ich mit den Tags Parameter in TaggedDocument, spielte und als ich es zu einer Mischung aus Text geändert und Zahlen wie: Doc1, Doc2, ... Ich sehe eine andere Zahl für die Anzahl der generierten Vektoren, aber ich habe immer noch nicht die gleiche Anzahl von Merkmalsvektoren wie erwartet.