I'm a noob student and I need your help :)

Hi Guys, I’m Pier and actually I’ve received a task from my Professor to carry out a project, I’m doing it on Google CoLab in order to share it in real-time with him. Actually I’m asked to replicate the codes published at the end of this article: https://medium.com/analytics-vidhya/semantic-similarity-in-sentences-and-bert-e8d34f5a4677

pip install bert-serving-server
pip install bert-serving-client
bert-serving-start -model_dir /tmp/english_L-12_H-768_A-12/ -num_worker=4
python BERT_test.py

The problem is that when i plug in the code in bold CoLab, as well as Anaconda, generates the following code error:

File “”, line 1
bert-serving-start -model_dir /tmp/english_L-12_H-768_A-12/ -num_worker=4
SyntaxError: invalid token

How can I solve it?

I think it can be a problem of the folder where the dataset is located because in the article it’s quoted, just before the code which generate the error, the following: " 2. In a new console window, start the BERT service. Note that you will have to choose the correct path and pre-trained model name for BERT". Thus, maybe it can be this one the problem. However, I don’t know how to create the new “path”. I have done in CoLab, so if someone can help me in this simple task I can share the link with you :slight_smile: Thanks a lot to everybody!

Have a nice weekend!

1 Like