(self, tfidf_path=None, strict=True)
Args:
            tfidf_path: path to saved model file
            strict: fail on empty queries or continue (and return empty result)
Args:
            tfidf_path: path to saved model file
            strict: fail on empty queries or continue (and return empty result)
Args : tfidf_path : path to saved model file strict : fail on empty queries or continue ( and return empty result )
def __init__(self, tfidf_path=None, strict=True):
        """
        Args:
            tfidf_path: path to saved model file
            strict: fail on empty queries or continue (and return empty result)
        """
        # Load from disk
        tfidf_path = tfidf_path
        logger.info('Loading %s' % tfidf_path)
        matrix, metadata = load_sparse_csr(tfidf_path)
        self.doc_mat = matrix
        self.ngrams = metadata['ngram']
        self.hash_size = metadata['hash_size']
        self.tokenizer = SimpleTokenizer()
        self.doc_freqs = metadata['doc_freqs'].squeeze()
        self.doc_dict = metadata['doc_dict']
        self.num_docs = len(self.doc_dict[0])
        self.strict = strict
def __init__ ( self , tfidf_path = None , strict = True ) : # Load from disk tfidf_path = tfidf_path logger . info ( 'Loading %s' % tfidf_path ) matrix , metadata = load_sparse_csr ( tfidf_path ) self . doc_mat = matrix self . ngrams = metadata [ 'ngram' ] self . hash_size = metadata [ 'hash_size' ] self . tokenizer = SimpleTokenizer ( ) self . doc_freqs = metadata [ 'doc_freqs' ] . squeeze ( ) self . doc_dict = metadata [ 'doc_dict' ] self . num_docs = len ( self . doc_dict [ 0 ] ) self . strict = strict