BERT word Embed

Bert model using Chinese words embedded in

Before JobCodeExtracarried out using the embedded word BERT model task is no problem. The process is to install several libraries, you can make calls via CS (Client, Server) way.

  1. pip install bert serving-client
  2. pip install bert-serving-server
  3. TensorFlow is to be installed
  4. Download BERT pre-training model

Must pay attention to Python, tensorflow version, or may cause incompatibility problems, in addition with other libraries seem to have compatibility issues, specifically, what is not clear. . .

After Before configuring the environment by the above method, cmdthe enter the corresponding Python installation position Script folder, because of the need to use a command bert-serving-start(of course, if there have been add the path to the environment variable, it may be omitted the step). Then execute bert-serving-start -model_dir F:/chinese_L-12_H-768_A-12to start the embedded word model.

It desperate question:

1. 后来可能因为我安装了许多其他的包,有些包还进行了卸载和更新等等操作,导致突然间这种方法不能用了!!!
2. 我的内心是绝望的,错误一直无法解决,网上也查询不到,问别人也没有解决。

Thinking:

In such cases are most likely configuration of environmental issues, a variety of packages mixed in the same version of the interpreter (Python), it can not compatible with this problem does not occur.

Solution:

Create a virtual environment, a separate library for the project installation needs, and later found really solve this problem. Finally see a long absence interface, very moved.

Next:

Now I do not pycharm ready to write the code for this project, it is not convenient debugging, the data itself is not a small amount, an error is encountered for a long time to run the job to stop error (mainly because of this word embedded method takes too long, but But my present only this method of embedding), behind me ready to use jupyter notebook to write programs. Has completed the previously unsupervised method based on similarity and SVM-based method, the following I would like to try the effect of neural networks. But before that, we have to solve a problem, how to jupyter notebook (or pycharm) configured virtual environment? We have to go step by step ......

PS: In fact, before also encountered some other problems, but have a simple solution, so no records (in fact, forget the record, QAQ)

Screenshot question:

Finally solved the screenshot problem:

Road difficult and distant, and the line and the line ~ ~ ~

Guess you like

Origin www.cnblogs.com/yerun/p/12652651.html