Exemplo n.º 1
0
	def createEvaluationfiles(self, dirCorpus, testPercentage, numberOfPartition, bibl_list):
		dirPartitions = self.getDirPartitionNames()
		for dirPartition in dirPartitions:
			(annotateDir, testDir, trainDir, modelDir, _) = self.getDirTestNames(dirPartition)
			testCorpus, trainCorpus = FormatEval.getShuffledCorpus(bibl_list, testPercentage)
			#print testCorpus
			#print trainCorpus
			
			# files used for training (100 - testPercentage % of the corpus)
			FormatEval.copy_files_for_eval(self.dirCorpus, trainDir, trainCorpus)
			# files used for evaluation keeping annotations (testPercentage % of the corpus)
			FormatEval.copy_files_for_eval(self.dirCorpus, testDir, testCorpus)
			# files used for evaluation, strip the annotations
			# they will be labeled by bilbo
			FormatEval.copy_files_for_eval(self.dirCorpus, annotateDir, testCorpus, 'bibl', strip=True)