Two classesTfidfTrainer() and TfidfEvaluator() 's __init__()are changed to receive objects from outside the class instead of initializing objects inside class. For example, for TfidfEvaluator(), when to initialize its object in main(), a object of preprocessor will be initialized first and passed into TfidfEvaluator()'s __init()__ as a parameter, as the following shows. And the similar changes are made to classesTfidfTrainer() as well.
Two classes
TfidfTrainer()
andTfidfEvaluator()
's__init__()
are changed to receive objects from outside the class instead of initializing objects inside class. For example, forTfidfEvaluator()
, when to initialize its object inmain()
, a object ofpreprocessor
will be initialized first and passed intoTfidfEvaluator()
's__init()__
as a parameter, as the following shows. And the similar changes are made to classesTfidfTrainer()
as well.