Module Expr Str ImportFrom alias alias alias alias Import alias ImportFrom alias Import alias ImportFrom alias ClassDef bases NameLoad body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Dict FunctionDef arguments args NameParam defaults body Expr Str Return Call SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Expr Str Return decorator_list AttributeLoad NameLoad attr decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Expr Str Assign NameStore Call NameLoad NameLoad For TupleStore NameStore NameStore NameLoad body Assert CompareGtE SubscriptLoad NameLoad Index NameLoad Num For TupleStore NameStore NameStore NameLoad body AugAssignAdd SubscriptStore NameLoad Index NameLoad NameLoad Return Call NameLoad Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Num keyword NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assert CompareGt NameLoad Num Return BinOpAdd Num Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assert CompareGt NameLoad Num Return Call NameLoad BinOpDiv NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults Str body If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults kwarg body Expr Str If CompareEq NameLoad Num body Return TupleLoad Assign NameStore Call NameLoad NameLoad For TupleStore NameStore NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad Assign NameStore BinOpMult Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad NameLoad For TupleStore NameStore NameStore NameLoad body AugAssignAdd SubscriptStore NameLoad Index NameLoad BinOpMult Call AttributeLoad NameLoad attr NameLoad NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad BinOpDiv NameLoad NameLoad Return Call NameLoad Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Num keyword NameLoad decorator_list decorator_list Expr Call AttributeLoad NameLoad attr Dict Str Str NameLoad NameLoad
N/A N/A 
Scoring algorithms for finding similar documents
 __future__ division absolute_import print_function unicode_literals N/A abc collections defaultdict N/A operator math log QueryScorer N/A object N/A N/A 
    Interface for query scorers which score similarity search results
    
    QueryScorers are used by the SimIndex.query() method to handle the
    scoring of similarity search results.    
     N/A __metaclass__ N/A abc ABCMeta N/A _scorers N/A make_scorer N/A N/A scorer_type N/A N/A N/A Returns a new scorer object N/A N/A N/A N/A QueryScorer _scorers N/A scorer_type N/A staticmethod register_scorers N/A N/A scorer_map N/A N/A N/A N/A N/A N/A QueryScorer _scorers update scorer_map N/A staticmethod score_docs N/A N/A self query_vec postings_lists N/A extra N/A N/A Scores documents' similarities to query
        
        Scans postings_lists to compute similarity scores for docs for the
        query term vector
        
        Params:
            query: the query document
            postings_lists: a list of postings lists for terms in query
        
        Returns:
            A sorted iterable of (docid, score) tuples
         N/A N/A N/A abc abstractmethod N/A SimpleCountQueryScorer N/A QueryScorer N/A N/A 
    QueryScorer that uses simple term frequencies for scoring.
     score_docs N/A N/A self query_vec postings_lists N/A extra N/A N/A 
        Scores query-document similarity using number of occurrences
        of query terms in document.  Multiple occurrences of a term
        in the query are ignored.
         N/A doc_hit_map N/A defaultdict int N/A N/A term postings_list postings_lists N/A N/A N/A N/A query_vec N/A term 1 N/A N/A docid freq postings_list N/A N/A N/A doc_hit_map N/A docid freq N/A N/A sorted N/A N/A doc_hit_map iteritems key N/A N/A operator itemgetter 1 reverse True N/A N/A TFIDFQueryScorer N/A QueryScorer N/A N/A 
    QueryScorer that uses TFIDF weighting with the cosine similarity measure.
    
    This implementation is actually an approximation to the true
    cosine, because of the way we normalize by document length.
    When computing document length, we assume a term weight of 1 for
    each document term. E.g., we do not factor in term weights
    when computing the "document length", since that would require
    choosing the weighting strategy at index time.
    
    Query length is ignored, as it has no effect on relative ordering
     tf_weight_raw N/A N/A tf N/A N/A N/A Returns unscaled tf N/A tf N/A staticmethod tf_weight_log N/A N/A tf N/A N/A N/A Returns sublinear scaling of tf: 1+log(tf) N/A N/A tf 0 N/A N/A 1 N/A log tf N/A staticmethod idf_weight_log N/A N/A N df N/A N/A N/A Returns idf weight N/A N/A df 0 N/A N/A log N/A N df N/A staticmethod __init__ N/A N/A self tf_weight_type N/A raw N/A N/A N/A tf_weight_type log N/A N/A N/A self tf_weight N/A self tf_weight_log N/A N/A N/A self tf_weight N/A self tf_weight_raw N/A N/A self idf_weight N/A self idf_weight_log N/A score_docs N/A N/A self query_vec postings_lists N get_doc_freq get_doc_len N/A extra N/A N/A 
        Scores documents' similarities to query using cosine similarity
        in a vector space model.  Uses tf.idf weighting.
        
        An individual term hit is scored as::
        
            idf * self.tf_weight(q_tf) * self.tf_weight(d_tf)
        
        The overall score for a doc is given by the sum of the term-hit scores
         N/A N/A N 0 N/A N/A N/A N/A doc_hit_map N/A defaultdict int N/A N/A term postings_list postings_lists N/A N/A idf N/A N/A self idf_weight N N/A get_doc_freq term N/A query_term_wt N/A N/A N/A self tf_weight N/A query_vec N/A term idf N/A N/A docid freq postings_list N/A N/A N/A doc_hit_map N/A docid N/A N/A N/A self tf_weight freq query_term_wt N/A N/A docid weight N/A N/A doc_hit_map iteritems N/A N/A doc_len N/A get_doc_len docid N/A N/A doc_hit_map N/A docid N/A weight doc_len N/A N/A sorted N/A N/A doc_hit_map iteritems key N/A N/A operator itemgetter 1 reverse True N/A N/A N/A N/A N/A QueryScorer register_scorers N/A simple_count tfidf SimpleCountQueryScorer TFIDFQueryScorer