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

ShotResultList Impala::Application::ActiveLearnEngine::RetrieveResults (  )  [inline]

Definition at line 215 of file ActiveLearnEngine.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::Trec::ThreadSet::GetKeyframes(), Impala::Core::Table::SimilarityTableSet::GetRankTable(), Impala::Core::Table::SimilarityTableSet::GetSimTable(), ILOG_DEBUG, ILOG_WARN, Impala::Core::Table::SimilarityTableSet::MakeFromFile(), mALDatabase, mErrCount, mInfoSent, mThreadSet, and Impala::QuidSet().

00216     {
00217         ILOG_DEBUG("Retrieving results...");
00218 
00219         String dir =
00220             "SimilarityIndex/conceptsActiveLearn.txt/activelearn/activelearn";
00221 
00222         String path = mALDatabase->GetFilePath(dir, "names.txt", false, false);
00223 
00224         Core::Table::SimilarityTableSet *conceptSet = 
00225             Core::Table::SimilarityTableSet::MakeFromFile(path, mALDatabase);
00226 
00227         Core::Table::SimilarityTableSet::RankTableType* rank = conceptSet->GetRankTable(GetID());
00228 
00229         ShotResultList out;
00230 
00231         if (!rank)
00232         {
00233             ILOG_DEBUG("Could not find ID, no data present. :'(");
00234             delete conceptSet;
00235             return out;
00236         }
00237 
00238         mInfoSent = false;
00239 
00240         int results = 5000;
00241 
00242         ILOG_DEBUG("Concept loaded, converting to list...");
00243         // find the Thread using the "concept" name
00244 
00245         std::map<int,bool> noduplicates;
00246         int rrank = 1;
00247         mErrCount = 0;
00248         int dropcount = 0;
00249         for (int i=0; i<results; i++)
00250         {
00251 
00252             Quid q = rank->Get1(i);
00253             if (QuidSet(q) == 23) {
00254                 dropcount++; 
00255                 // ILOG_DEBUG("silent drop of result " << i <<": from topic set.");
00256                 mErrCount++;
00257                 continue;
00258             }
00259             /*
00260             if (QuidSet(q) != 11 && QuidSet(q) != 12) {
00261                 ILOG_ERROR("data not from trec2008devel or test set, dropping results.");
00262                 // added to limit effects of race condition
00263                 // which happens when the server is still writing results and the
00264                 // user already is loading the file. A better approach would be to
00265                 // rewrite this entire file to use network comms instead of thumper
00266                 // based comms instead.
00267                 mErrCount++;
00268                 mInfoSent = true;
00269                 delete conceptSet;
00270                 return out;
00271             }
00272             */
00273 
00274             int keyframe = mThreadSet->GetKeyframes()->GetFrameId(q);
00275 
00276             if (keyframe < 0) {
00277                 ILOG_WARN("erroneous result " << QuidObj(q) << " for this set, dropping.");
00278                 mErrCount++;
00279                 continue;
00280             }
00281 
00282             int shot = mThreadSet->GetKeyframes()->GetShotId(keyframe);
00283 
00284             if (shot > -1 && noduplicates.find(shot) == noduplicates.end())
00285             {
00286                 ShotResult r;
00287                 r.shotid = shot;
00288                 r.rank = rrank++;
00289                 r.score = conceptSet->GetSimTable(GetID())->Get1(conceptSet->FindQuid(q));
00290 //                if (rrank < 10)
00291 //                    ILOG_DEBUG("RECV: " << r.rank << ": " << r.shotid << " (" << r.score << ")");
00292                 noduplicates[shot] = true;
00293                 out.push_back(r);
00294             }
00295         }
00296        
00297         if (dropcount > 0)
00298             ILOG_DEBUG("there were " << dropcount << " silent drops from results");
00299         if (mErrCount > 0)
00300             ILOG_DEBUG("there were " << mErrCount << " errors while receiving results");
00301 
00302         delete conceptSet;
00303 
00304         return out;     
00305     }

Here is the call graph for this function:


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