00001 /*========================================================================== 00002 * Copyright (c) 2002 Carnegie Mellon University. All Rights Reserved. 00003 * 00004 * Use of the Lemur Toolkit for Language Modeling and Information Retrieval 00005 * is subject to the terms of the software license set forth in the LICENSE 00006 * file included with this software, and also available at 00007 * http://www.lemurproject.org/license.html 00008 * 00009 *========================================================================== 00010 */ 00011 #ifndef _MMRPASSAGE_HPP 00012 #define _MMRPASSAGE_HPP 00013 00014 #include <iomanip> 00015 #include "Passage.hpp" 00016 #include <vector> 00017 00018 using std::vector; 00019 00020 namespace lemur 00021 { 00022 namespace summarization 00023 { 00024 00030 class MMRPassage : public Passage { 00031 00032 public: 00033 double wt; 00034 double wtSim; 00035 double qSim; 00036 double maxSim; 00037 00038 MMRPassage(const string &id) { 00039 docID = id; 00040 score = -1; 00041 marked = 0; 00042 wt = 1.0; 00043 qSim = 0.0; 00044 wtSim = 0.0; 00045 maxSim = -1.0; 00046 } 00047 // have to clean up 00048 ~MMRPassage() { 00049 // delete psg; 00050 } 00051 00052 virtual void clear(); 00053 00054 virtual void addTerm(termCount term); 00055 00056 virtual void addTerms(const passageVec pv); 00057 00058 virtual const passageVec* getAsVector(void) const; 00059 00060 virtual int operator<(const Passage &b) const; 00061 00062 virtual double computeMMR(double lambda) const; 00063 00064 virtual double dotProduct(MMRPassage b) const; 00065 00066 // This is NOT const, it modifies psg. 00067 // virtual void scale(double val) const; 00068 virtual void scale(double val) ; 00069 00070 }; 00071 } 00072 } 00073 00074 #endif