2bfe5bfcec7759ae022b1a479411aa7d1b8401f1,example/example7.py,,,#,26

Before Change


    print("wait until server is ready...")
    time.sleep(15)
    print("encoding...")
    bc = BertClient(port=common["port"], port_out=common["port_out"], show_server_config=True)
    subset_vec_all_layers.append(bc.encode(subset_text))
    bc.close()
    server.close()

After Change


np.save("example7_5k_2_subset_label",np_subset_label)

//load bert vectors and labels
subset_vec_all_layers = np.load("example7_5k_mxnet.npy")
np_subset_label = np.load("example7_5k_mxnet_subset_label.npy")
subset_label = np_subset_label.tolist()
//=========================== visulize ===========================
def vis(embed, vis_alg="PCA", pool_alg="REDUCE_MEAN"):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: hanxiao/bert-as-service
Commit Name: 2bfe5bfcec7759ae022b1a479411aa7d1b8401f1
Time: 2019-05-06
Author: zyn2122@gmail.com
File Name: example/example7.py
Class Name:
Method Name:


Project Name: uber/ludwig
Commit Name: 13eb6bf434f384c45ba1d92ad1dcda04fc6f0517
Time: 2020-08-22
Author: piero@uber.com
File Name: tests/integration_tests/test_collect.py
Class Name:
Method Name: test_collect_weights


Project Name: tryolabs/luminoth
Commit Name: 8a600f790ba68880e9a76a5eda33a3f4fccd22c4
Time: 2017-11-17
Author: javirey@gmail.com
File Name: luminoth/utils/predicting.py
Class Name:
Method Name: get_predictions