45d7f12d66addc6235333e70ebefefce96b86150,underthesea/classification/bank/__init__.py,,classify,#Any#,20
Before Change
global classifier
if not classifier:
if os.path.exists(model_path):
classifier = TextClassifier.load(model_path)
else:
logger.error(
f"Could not load model at {model_path}.\n"
f"Download model with \"underthesea download {UTSModel.tc_bank.value}\".")
sys.exit(1)
sentence = Sentence(X)
classifier.predict(sentence)
labels = sentence.labels
if not labels:
After Change
def classify(X):
global classifier
model_name = "TC_BANK_V131"
model_path = ModelFetcher.get_model_path(model_name)
if not classifier:
if not os.path.exists(model_path):
ModelFetcher.download(model_name)
classifier = TextClassifier.load(model_path)
sentence = Sentence(X)
classifier.predict(sentence)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 12
Instances
Project Name: undertheseanlp/underthesea
Commit Name: 45d7f12d66addc6235333e70ebefefce96b86150
Time: 2021-01-07
Author: anhv.ict91@gmail.com
File Name: underthesea/classification/bank/__init__.py
Class Name:
Method Name: classify
Project Name: undertheseanlp/underthesea
Commit Name: 45d7f12d66addc6235333e70ebefefce96b86150
Time: 2021-01-07
Author: anhv.ict91@gmail.com
File Name: underthesea/sentiment/bank/__init__.py
Class Name:
Method Name: sentiment
Project Name: undertheseanlp/underthesea
Commit Name: 45d7f12d66addc6235333e70ebefefce96b86150
Time: 2021-01-07
Author: anhv.ict91@gmail.com
File Name: underthesea/classification/vntc/__init__.py
Class Name:
Method Name: classify
Project Name: undertheseanlp/underthesea
Commit Name: 45d7f12d66addc6235333e70ebefefce96b86150
Time: 2021-01-07
Author: anhv.ict91@gmail.com
File Name: underthesea/sentiment/general/__init__.py
Class Name:
Method Name: sentiment