Skip to content

Instantly share code, notes, and snippets.

@mohdsanadzakirizvi
Created September 23, 2019 18:03
Show Gist options
  • Save mohdsanadzakirizvi/436ce87e5eb961473459d8bdcbd7eb7f to your computer and use it in GitHub Desktop.
Save mohdsanadzakirizvi/436ce87e5eb961473459d8bdcbd7eb7f to your computer and use it in GitHub Desktop.
from bert_serving.client import BertClient
# make a connection with the BERT server using it's ip address
bc = BertClient(ip="YOUR_SERVER_IP")
# get the embedding for train and val sets
X_tr_bert = bc.encode(X_tr.tolist())
X_val_bert = bc.encode(X_val.tolist())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment