TensorFlow Wrapper

you can read all about TensorFlow here.

class wrappers.tensorflow_wrapper.TensorFlowWrapper(embedding_layer_hub_name: str)[source]

Wrapper object for TensorFlow graph and helps use it.

append_scores(sentence_pairs: pandas.core.frame.DataFrame) → None[source]

Appending scoring of cosine similarity based on the given embedding layer.

Parameters

sentence_pairs – DataFrame matrix of paired sentences with the columns [“sent_1”, “sent_2”] where each row is a paired sentences.

Returns

None; it append to given DataFrame new column “score” with the cosine similarity score for each pair in each row.

close()[source]

closes the TensorFlow session.

←back to github