Skip to content

Commit

Permalink
Python3 Version Compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredFern committed Aug 1, 2017
1 parent ff879fc commit 3b907e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions vecshare/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def refresh(force_update=False):
file_format = curr_emb['format']
vocab_size = dw.query(set_name , "SELECT COUNT(text) FROM " + emb_name).dataframe.iloc[0][0]

print "Newly Indexed embedding: " + emb_name+ " from dataset " + set_name + "."
print ("Newly Indexed embedding: " + emb_name+ " from dataset " + set_name + ".")
meta_dict.update({
u'embedding_name': emb_name,
u"dataset_name": set_name,
Expand All @@ -93,7 +93,7 @@ def refresh(force_update=False):
u"last_updated": last_updated})
embeddings.append(deepcopy(meta_dict))
else:
print "Re-indexed embedding: " + emb_name+ " from dataset " + set_name + "."
print ("Re-indexed embedding: " + emb_name+ " from dataset " + set_name + ".")
query = 'SELECT * FROM '+ INDEX_FILE + ' WHERE dataset_name = "'+ \
set_name +'" and embedding_name = "'+ emb_name +'"'
prev_row = dw.query(INDEXER, query).dataframe
Expand All @@ -106,10 +106,10 @@ def refresh(force_update=False):
for emb in embeddings:
csv_writer.writerow(emb)

print "Updating index file at " + INDEXER_URL
print ("Updating index file at " + INDEXER_URL)
dw_api.upload_files(INDEXER, os.getcwd() + '/'+ INDEX_FILE +'.csv')
if updated:
print "Updating avg_rank signatures"
print ("Updating avg_rank signatures")
avgrank_refresh()


Expand Down
1 change: 0 additions & 1 deletion vecshare/signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def avgrank(inp_dir):
stopwords = signatures.pop('stopwords', None)
test_vocab = avgrank_corp(inp_dir,stopwords)
for emb_name,emb_sig in signatures.items():
if len(emb_sig) <100: print emb_sig
rank_dict.update({emb_name: 0})
for ind in range(0,len(signatures[emb_name])):
curr_inpword = signatures[emb_name][ind]
Expand Down

0 comments on commit 3b907e3

Please sign in to comment.