Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

QuidResultList Impala::Samples::ActiveLearnEngineQuids::RetrieveResults (  )  [inline]

Definition at line 164 of file ActiveLearnEngineQuids.h.

References Impala::Core::Table::SimilarityTableSet::FindQuid(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::Util::Database::GetFilePath(), GetID(), Impala::Core::Table::SimilarityTableSet::GetRankTable(), Impala::Core::Table::SimilarityTableSet::GetSimTable(), ILOG_DEBUG, ILOG_ERROR, Impala::Core::Table::SimilarityTableSet::MakeFromFile(), mALDatabase, mErrCount, mInfoSent, Impala::Core::Trec::QuidResult::quid, Impala::QuidSet(), Impala::Core::Trec::QuidResult::rank, and Impala::Core::Trec::QuidResult::score.

00165     {
00166         ILOG_DEBUG("Retrieving results...");
00167 
00168         String dir =
00169             "SimilarityIndex/conceptsActiveLearn.txt/activelearn/activelearn";
00170 
00171         String path = mALDatabase->GetFilePath(dir, "names.txt", false, false);
00172 
00173         Core::Table::SimilarityTableSet *conceptSet = 
00174             Core::Table::SimilarityTableSet::MakeFromFile(path, mALDatabase);
00175 
00176         Core::Table::SimilarityTableSet::RankTableType* rank = conceptSet->GetRankTable(GetID());
00177 
00178         QuidResultList out;
00179 
00180         if (!rank)
00181         {
00182             ILOG_DEBUG("Could not find ID, no data present. :'(");
00183             delete conceptSet;
00184             return out;
00185         }
00186 
00187         mInfoSent = false;
00188 
00189         int results = 5000;
00190 
00191         ILOG_DEBUG("Concept loaded, converting to list...");
00192         // find the Thread using the "concept" name
00193 
00194         std::map<int,bool> noduplicates;
00195         int rrank = 1;
00196         mErrCount = 0;
00197         int dropcount = 0;
00198         for (int i=0; i<results; i++)
00199         {
00200 
00201             Quid q = rank->Get1(i);
00202 /*            if (QuidSet(q) == 23) {
00203                 dropcount++; 
00204                 // ILOG_DEBUG("silent drop of result " << i <<": from topic set.");
00205                 mErrCount++;
00206                 continue;
00207             } */
00208             if (QuidSet(q) != 11 && QuidSet(q) != 12) {
00209                 ILOG_ERROR("data not from trec2008devel or test set, dropping results.");
00210                 // added to limit effects of race condition
00211                 // which happens when the server is still writing results and the
00212                 // user already is loading the file. A better approach would be to
00213                 // rewrite this entire file to use network comms instead of thumper
00214                 // based comms instead.
00215                 mErrCount++;
00216                 mInfoSent = true;
00217                 delete conceptSet;
00218                 return out;
00219             }
00220 
00221             if (q > -1)
00222             {
00223                 Core::Trec::QuidResult r;
00224                 r.quid = q;
00225                 r.rank = rrank++;
00226                 r.score = conceptSet->GetSimTable(GetID())->Get1(conceptSet->FindQuid(q));
00227                 out.push_back(r);
00228             }
00229         }
00230        
00231         if (dropcount > 0)
00232             ILOG_DEBUG("there were " << dropcount << " silent drops from results");
00233         if (mErrCount > 0)
00234             ILOG_DEBUG("there were " << mErrCount << " errors while receiving results");
00235 
00236         delete conceptSet;
00237 
00238         return out;
00239     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:38:08 2010 for ImpalaSrc by  doxygen 1.5.1