def load_data(path, name, command): list_ = load_file(path, name) X = list() for line in list_: split_line = line.split('\t') text = split_line[3] if command == 'preprocessText': text = clean_url(text) X.append(text) return X
def load_data_ubicomp(): db = MySQLdb.connect(host="127.0.0.1", # your host, usually localhost user="******", # your username passwd="ducthong", # your password db="2015_allschemas") # name of the data base cur = db.cursor() # Use all the SQL you like cur.execute("select tweetID, tweetText from twitter_icwsm_correct") data_id, data_text = list(), list() for row in cur.fetchall(): data_id.append(row[0]) data_text.append(clean_url(row[1])) return data_id, data_text