Python Script: Converts .tsv to TFRecord
I am no expert in TensorFlow (even though started to grasp), but here are some things I noticed:


if this is a proper valid TSV file, you should not be worried about checking the length of each row - each row should have the same amount of columns
you may also try to use TextLineReader to read features from a csv file like noted here, this may lead to "unpacking" the features and avoiding getting them by index:

rate, sent1, sent2 = tf.decode_csv(value)

if, for some reason, TextLineReader is not applicable, you may unpack in the for loop:

for rate, sent1, sent2 in read_tsv:

you can also look into applying some micro-optimizations, like avoiding name lookups in the loop by pre-lookuping things before the loop - e.g. setting Example = tf.train.Example and then using Example in place of tf.train.Example
there is also a possibility of that classic trading off memory for the speed. Depending on how unique your features are, you, for instance, can "cache" the word tokenization results in a dictionary to avoid re-tokenizing the same sentences over again


Also check out the TensorFlow Performance Guide and Performance Tips.

There are also some minor PEP8 code style violations, like extra spaces around = in the keyword argument definitions - run your code through a static code analyzer like flake8 or pylint.