Skip to content

Instantly share code, notes, and snippets.

@evu
Created November 16, 2019 00:59
Show Gist options
  • Save evu/6f6a304a161db5c625fab10055fe2dd4 to your computer and use it in GitHub Desktop.
Save evu/6f6a304a161db5c625fab10055fe2dd4 to your computer and use it in GitHub Desktop.
Pandas DataFrame to tensorflow embedding projector .tsv
word_df.to_csv("words.tsv", sep="\t", header=False, index=False, quoting=csv.QUOTE_NONE, quotechar="", escapechar="\\")
vec_df.to_csv("vectors.tsv", sep="\t", header=False, index=False, quoting=csv.QUOTE_NONE, quotechar="", escapechar="\\")
@EbrahimKaram
Copy link

Hey
Do you know any more details?

I know how to get my dataframe into a TSV but I'm not understanding how to get the labels into the data.

I don't know how to use the metadata option

@evu
Copy link
Author

evu commented Jul 17, 2020

@EbrahimKaram That's what the words.tsv file is for... row 0 of the words.tsv file is associated with row 0 of the vectors.tsv file, etc. The words.tsv file can just be a single column with your vector labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment