[docs]defcreate_model(self,dataset:Dataset,k:int,vector_size:int,batch_size:int,model_path:Path,sequence_type:SequenceType):fromgensim.modelsimportWord2Vecmodel=Word2Vec(vector_size=vector_size,min_count=1,window=self.window)# creates an empty modelall_kmers=KmerHelper.create_all_kmers(k=k,alphabet=EnvironmentSettings.get_sequence_alphabet())all_kmers=[[kmer]forkmerinall_kmers]model.build_vocab(all_kmers)ifisinstance(dataset,RepertoireDataset):model=self._create_for_repertoire(dataset,batch_size,k,model,all_kmers,sequence_type)elifisinstance(dataset,SequenceDataset):model=self._create_for_sequences(dataset,batch_size,k,model,all_kmers,sequence_type)model.save(str(model_path))returnmodel