예제 #1
0
        wr_q = np.zeros(wr_len)  # TBD how to represent
        doc_set = X[query]  # given a ordered doc set
        s = []
        R = HsR[query]

        for i, doc in enumerate(doc_set):

            if not s:  # if s is empty of docs
                s.append(doc)
                continue

            else:
                # compute wd_q for one
                hs_ofR = R[i-1]
                # compute wr_q for one
                doc_r = doc_it(doc)
                # compute wd_q for rest
                wd_rest = compute_wd(doc_set[i:], s, query, wd_q, wr_q, R[i-1:])
                # compute wr_q for rest
                wr_rest = compute_wr(doc_set[i:], s, query, wd_q, wr_q, R[i-1:])
                # compute denominator
                denom = compute_denom(doc_set[i:], s, query, wd_q, wr_q, R[i-1:])

            # subtract wd_q
            wd_q += wd_rest / denom - hs_ofR
            # subtract wr_q
            wr_q += wr_rest / denom - doc_r
            # update w's
            s.append(doc)
            print i, str(datetime.now())
            
예제 #2
0
        wr_q = np.zeros(wr_len)  # TBD how to represent
        doc_set = X[query]  # given a ordered doc set
        s = []
        R = HsR[query]

        for i, doc in enumerate(doc_set):

            if not s:  # if s is empty of docs
                s.append(doc)
                continue

            else:
                # compute wd_q for one
                hs_ofR = R[i - 1]
                # compute wr_q for one
                doc_r = doc_it(doc, query)
                # compute wd_q for rest
                wd_rest = compute_wd(doc_set[i:], s, query, wd_q, wr_q,
                                     R[i - 1:])
                # compute wr_q for rest
                wr_rest = compute_wr(doc_set[i:], s, query, wd_q, wr_q,
                                     R[i - 1:])
                # compute denominator
                denom = compute_denom(doc_set[i:], s, query, wd_q, wr_q,
                                      R[i - 1:])

            # subtract wd_q
            wd_q += wd_rest / denom - hs_ofR
            # subtract wr_q
            wr_q += wr_rest / denom - doc_r
            # update w's
예제 #3
0
        wr_q = np.zeros(wr_len)  # TBD how to represent
        doc_set = X[query]  # given a ordered doc set
        s = []
        R = HsR[query]

        for i, doc in enumerate(doc_set):

            if not s:  # if s is empty of docs
                s.append(doc)
                continue

            else:
                # compute wd_q for one
                hs_ofR = R[i-1]
                # compute wr_q for one
                doc_r = doc_it(doc, query)
                # compute wd_q for rest
                wd_rest = compute_wd(doc_set[i:], s, query, wd_q, wr_q, R[i-1:])
                # compute wr_q for rest
                wr_rest = compute_wr(doc_set[i:], s, query, wd_q, wr_q, R[i-1:])
                # compute denominator
                denom = compute_denom(doc_set[i:], s, query, wd_q, wr_q, R[i-1:])

            # subtract wd_q
            wd_q += wd_rest / denom - hs_ofR
            # subtract wr_q
            wr_q += wr_rest / denom - doc_r
            # update w's
            s.append(doc)
            print i, str(datetime.now())
            
예제 #4
0
        wr_q = np.zeros(wr_len)  # TBD how to represent
        doc_set = X[query]  # given a ordered doc set
        s = []
        R = HsR[query]

        for i, doc in enumerate(doc_set):

            if not s:  # if s is empty of docs
                s.append(doc)
                continue

            else:
                # compute wd_q for one
                hs_ofR = R[i - 1]
                # compute wr_q for one
                doc_r = doc_it(doc)
                # compute wd_q for rest
                wd_rest = compute_wd(doc_set[i:], s, query, wd_q, wr_q,
                                     R[i - 1:])
                # compute wr_q for rest
                wr_rest = compute_wr(doc_set[i:], s, query, wd_q, wr_q,
                                     R[i - 1:])
                # compute denominator
                denom = compute_denom(doc_set[i:], s, query, wd_q, wr_q,
                                      R[i - 1:])

            # subtract wd_q
            wd_q += wd_rest / denom - hs_ofR
            # subtract wr_q
            wr_q += wr_rest / denom - doc_r
            # update w's