def __init__(self): self.dist = Utils.dist() self.nltk_Tools = Utils.nltk_tools() self.pickler = Utils.pickler() self.tools = Utils.tools() self.weight = Utils.weight() self.dataset_tools = Utils.dataset_tools(self.dist, self.nltk_Tools, self.pickler, self.tools) self.extractor = Feature_Extractor.extractor(self.dist, self.nltk_Tools, self.pickler, self.tools, self.weight, "authors", "titles") # Load model for prediction self.model = self.pickler.loadPickle('ModelCFS.pickle') self.model_v2 = self.pickler.loadPickle('ModelCFS_v2.pickle')
def __init__(self): self.dist = Utils.dist() self.nltk_Tools = Utils.nltk_tools() self.pickler = Utils.pickler() self.tools = Utils.tools() self.weight = Utils.weight() self.dataset_tools = Utils.dataset_tools(self.dist, self.nltk_Tools, self.pickler, self.tools) self.extractor = Feature_Extractor.extractor(self.dist, self.nltk_Tools, self.pickler, self.tools, self.weight, "authors", "titles") # Load model for prediction self.model = self.pickler.loadPickle('ModelCFS.pickle') self.model_v2 = self.pickler.loadPickle('ModelCFS_v2.pickle')
import Feature_Extractor import Utils import sys if __name__ == '__main__': nltk_Tools = Utils.nltk_tools() tools = Utils.tools() weight = Utils.weight() dist = Utils.dist() pickler = Utils.pickler() dataset_tools = Utils.dataset_tools(dist, nltk_Tools, pickler, tools) authors = pickler.loadPickle(pickler.pathAuthors) titles = pickler.loadPickle(pickler.pathTitles) run = Feature_Extractor.extractor(dist, nltk_Tools, pickler, tools, weight, authors, titles) raw = pickler.loadPickle(pickler.pathRaw) annotations = pickler.loadPickle(pickler.pathAnnotations) experiment = dataset_tools.fetchExperiment(raw) (forannotation, keys, X, targets) = dataset_tools.prepDataset(run, raw, experiment, annotations) pickler.dumpPickle(forannotation, "For_Annotation") pickler.dumpPickle(keys, "DatasetTBA_keys") pickler.dumpPickle(X, "DatasetTBA") pickler.dumpPickle(targets, "Targets") #(forannotation, keys, X) = dataset_tools.prepDatasetCFS(run, raw, experiment) #pickler.dumpPickle(forannotation, "For_AnnotationCFS") #pickler.dumpPickle(keys, "DatasetTBA_keysCFS") #pickler.dumpPickle(X, "DatasetTBACFS")
import Feature_Extractor import Utils import sys if __name__ == '__main__': nltk_Tools = Utils.nltk_tools() tools = Utils.tools() weight = Utils.weight() dist = Utils.dist() pickler = Utils.pickler() dataset_tools = Utils.dataset_tools(dist, nltk_Tools, pickler, tools) authors = pickler.loadPickle(pickler.pathAuthors) titles = pickler.loadPickle(pickler.pathTitles) run = Feature_Extractor.extractor(dist, nltk_Tools, pickler, tools, weight, authors, titles) raw = pickler.loadPickle(pickler.pathRaw) annotations = pickler.loadPickle(pickler.pathAnnotations) experiment = dataset_tools.fetchExperiment(raw) experiment = experiment[0:200] (forannotation, keys, X, targets) = dataset_tools.prepDataset(run, raw, experiment, annotations) pickler.dumpPickle(forannotation, "For_Annotation") pickler.dumpPickle(keys, "DatasetTBA_keys") pickler.dumpPickle(X, "DatasetTBA") pickler.dumpPickle(targets, "Targets") #(forannotation, keys, X) = dataset_tools.prepDatasetCFS(run, raw, experiment) #pickler.dumpPickle(forannotation, "For_AnnotationCFS")