Initially, I install Senta and try it in the terminal.
It only works when the current folder is Senta (must run cd .../Senta), so if my python script is not in the folder Senta, the function model.init_model() will download model again. In addition, if the model has been downloaded when I tried it in the terminal, the Senta will fail to find the proper location of the model, and return a FileNotFoundError.
As a result, I rewrite the Senta/senta/train.py to fix this problem. Since GitHub doesn't support .py file type, I change the extension to .txt.
from package_fixed.train import Senta
model = Senta(installed_path="/home/cld/stockemo/Senta/senta")
model.init_model(model_class="ernie_1.0_skep_large_ch", task="sentiment_classify", use_cuda=True)
Environment: Ubuntu 18.04 & PaddlePaddle 1.8.3.post107 & CUDA: 10.2
Initially, I install Senta and try it in the terminal.
It only works when the current folder is
Senta
(must runcd .../Senta
), so if my python script is not in the folderSenta
, the functionmodel.init_model()
will download model again. In addition, if the model has been downloaded when I tried it in the terminal, theSenta
will fail to find the proper location of the model, and return a FileNotFoundError.As a result, I rewrite the
Senta/senta/train.py
to fix this problem. Since GitHub doesn't support.py
file type, I change the extension to.txt
.train.py.txt
Usage: