def setUp(self): fill_database() add_vendors() config_ = load_config(file_path="/vagrant/config.yaml", logger=logger) self.feature_extractor = TfidfFeatureExtractor(prefix=config_['prefix']) self.ranker = ArticleRanker(extractor=self.feature_extractor) self.body = '{"news_vendor": "boingboing", ' \ '"features": ' \ '{"version": "TF-IDF-1.1", ' \ '"data": [[87, 1.0]]}, ' \ '"author": "David Pescovitz", ' \ '"headline": "Documentary about Astro Boy creator Osamu\\u00a0Tezuka",' \ ' "content": "<p class=\\"byline permalink\\"><a href=\\"http://boingboing.net/author/david_pescovitz\\" title=\\"Posts by David Pescovitz\\" rel=\\"author\\">David Pescovitz</a> at 9:33 am Wed, Oct 23, 2013 \\n\\n\\n\\n</p>", ' \ '"clean_content": "David Pescovitz at 9:33 am Wed, Oct 23, 2013 ",' \ ' "link": "http://rss.feedsportal.com/c/35208/f/653965/s/32d1ba95/sc/38/l/0Lboingboing0Bnet0C20A130C10A0C230Cdocumentary0Eabout0Eastro0Eboy0Ecr0Bhtml/story01.htm"}' self.article_as_dict = json.loads(self.body)
def setUp(self): fill_database() config_ = load_config(file_path="/vagrant/config.yaml", logger=logger) self.feature_extractor = EsaFeatureExtractor(prefix=config_['prefix']) self.ranker = ArticleRanker(extractor=self.feature_extractor) self.article_as_dict = {'news_vendor': 'TechCrunch', 'author': "MG Siegler", 'link': "http://www.techcrunch.com", 'headline': "Again Apple", 'clean_content': "Fooobaaar!", 'content': "<p>Fooobaaar!</p>", 'features': {'version': '1.0', 'data': [(1, 0.5), (3, 0.6) ] } }
def setUp(self): logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG) config = load_config(file_path="/vagrant/config.yaml", logger=logger, exit_with_error=True) #Connect to test database connect("nyan_test", port=27017) fill_database() #connect(config['database']['db-name'], # username= config['database']['user'], # password= config['database']['passwd'], # port = config['database']['port']) self.user_id = User.objects(email=u'*****@*****.**').first().id #feature_extractor = EsaFeatureExtractor(prefix = config['prefix']) feature_extractor = TfidfFeatureExtractor(prefix=config['prefix']) self.trainer = UserModelSVM(self.user_id, extractor=feature_extractor)
def setUp(self): logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG) config = load_config(file_path = ("/media/sdc1/Aptana Studio 3 Workspace" "/configs/config.yaml"), logger = logger, exit_with_error = True) #Connect to test database connect("nyan_test", port = 20545) fill_database() #connect(config['database']['db-name'], # username= config['database']['user'], # password= config['database']['passwd'], # port = config['database']['port']) self.user_id = User.objects(email = u'*****@*****.**').first().id #feature_extractor = EsaFeatureExtractor(prefix = config['prefix']) feature_extractor = TfidfFeatureExtractor(prefix = config['prefix']) self.trainer = UserModelSVM(self.user_id, extractor = feature_extractor)
def setUp(self): logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.DEBUG) config = load_config(file_path = "/home/karten/Programmierung/frontend/config.yaml", logger = logger, exit_with_error = True) #Connect to test database connect("nyan_test", port = 27017) fill_database() #connect(config['database']['db-name'], # username= config['database']['user'], # password= config['database']['passwd'], # port = config['database']['port']) self.user_id = User.objects(email = u'*****@*****.**').first().id #self.feature_extractor = EsaFeatureExtractor(prefix = config['prefix']) self.feature_extractor = TfidfFeatureExtractor(prefix = config['prefix']) self.trainer = UserModelCentroid(self.user_id, extractor = self.feature_extractor)