1. wooparadog
  2. 42qu-data

Commits

wooparadog  committed 2c24a36

f

  • Participants
  • Parent commits 4421e03
  • Branches default

Comments (0)

Files changed (3)

File tfidf/classification.py

View file
 那下一个是Pinterest吗?它能不能在中国顺利的成长?我觉得借鉴一下delicious的经验就可以知道这是很难的一条路,yupoo也没有完全复制Flickr的成功。或许或许,在中国Pinterest的机会不在花瓣,而在于美丽说。    
 '''
     cla = GetTag()
-    cla.get_tag(txt)
+    for i in cla.get_tag(txt):
+        print i
 
 #ID2TAG = TAG2ID.id2word()
 #

File tfidf/config.py

View file
 CURRENT_PATH = path.dirname(path.abspath(__file__))
 
 DATA_DIR = path.join(CURRENT_PATH,'data')
+DB_PATH = "/mnt/42qu_data/db/"

File tfidf/train/convert2array.py

View file
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
+import _env
 from itertools import tee, izip
 from array import array
 import sys
 import os.path as path
 from kyotocabinet import *
+from tfidf.config import DB_PATH
 
 MAX_INT = (1<<32)-1
 CURRENT_PATH = path.dirname(path.abspath(__file__))
         super(DB_Kyoto, self).__init__()
         self.db = DB()
         self.db_file = db_file
-        if not self.db.open(path.join(CURRENT_PATH,self.db_file), DB.OWRITER | DB.OCREATE):
+        if not self.db.open(path.join(DB_PATH,self.db_file), DB.OWRITER | DB.OCREATE):
             print >>sys.stderr, "open error: " + str(self.db.error())