Last active
September 23, 2019 16:30
-
-
Save mohdsanadzakirizvi/b2a1c57fafcf87a1b0b960a1fe4d58e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bert_serving.client import BertClient | |
# make a connection with the BERT server using it's ip address; do not give any ip if same computer | |
bc = BertClient(ip="SERVER_IP_HERE") | |
# get the embedding | |
embedding = bc.encode(["I love data science and analytics vidhya."]) | |
# check the shape of embedding, it should be 1x768 | |
print(embedding.shape) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment