Classifier.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:pyTweetBot 作者: nschaetti 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号