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

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

Definition at line 183 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, Impala::Core::Table::SimilarityTableSet::MakeFromFile(), mALDatabase, mErrCount, mInfoSent, Impala::Core::Trec::QuidResult::quid, Impala::Core::Trec::QuidResult::rank, and Impala::Core::Trec::QuidResult::score.

Referenced by Impala::Application::ConceptLearnClient::DoActiveLearning().

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

Here is the call graph for this function:


Generated on Thu Jan 13 09:14:39 2011 for ImpalaSrc by  doxygen 1.5.1