def load_model(config, model):
"""
Load a complete model and censor with path to model
:param config:
:param model:
:return:
"""
# Load model
model = Classifier.load(model)
censor = CensorModel(config)
# Tokenizer
tokenizer = TweetTokenizer()
# Join features
bow = features.BagOfGrams()
# Bag of gram, 2-grams, 3-grams
bow.add(features.BagOfWords())
bow.add(features.BagOf2Grams())
bow.add(features.BagOf3Grams())
return tokenizer, bow, model, censor
# end load_model
# end Classifier
评论列表
文章目录