Question for the BertClient

Initialise the BertClient object

from quantrautil import get_ip_address

bc = BertClient(ip=get_ip_address())


On your local machine comment the above line and uncomment and run the below line of code

bc = BertClient()


When I run this code, there are some error here:
ImportError: cannot import name 'get_ip_address' from 'quantrautil' (C:\Users\admin\Anaconda3\lib\site-packages\quantrautil\__init__.py)

Quantrautil is a Quantra's internal package. If you are trying to run the BERT model on your local system, you need to comment the below lines of code  



# from quantrautil import get_ip_address

# bc = BertClient(ip=get_ip_address())



and uncomment this line of code: 

bc = BertClient()



BERT model Setup or Installaton Procedures are covered in the Section 12 Unit 4 "BERT Setup" reading document.

Why this code takes time in executing ?



bc = BertClient()

bc = BertClient() takes forever to complete in a local system when it can not find the BERT service in the background. To start the BERT service you can check this resource. 



The code in Quantra Notebook
 works because the BERT service is already started in the background.



Note: The BERT service works well until TensorFlow version 1.15.0. The Quantra environment has version 1.12.0 and all code has been tested for that. For TensorFlow>=2.0 the external bert-as-service package does not work at the moment.