10#ifndef LIMA_LINGUISTICPROCESSING_POSTAGGER_VITERBIPOSTAGGER_H
11#define LIMA_LINGUISTICPROCESSING_POSTAGGER_VITERBIPOSTAGGER_H
46#define VITERBIPOSTAGGER_CLASSID "ViterbiPosTagger"
51template<
typename Cost,
typename CostFunction>
56 m_costFunction(costFunction),
94 std::vector<LinguisticCode> m_predPredMicros;
99 typedef std::map< LinguisticCode, std::vector<PredData> >
MicroCatDataMap;
100 typedef typename std::map< LinguisticCode, std::vector<PredData> >::iterator
MicroCatDataMapItr;
107 std::vector<uint64_t> m_predStepIndexes;
114 struct TargetVertexId
117 LinguisticCode m_categ;
118 std::vector<LinguisticCode> m_preds;
119 bool operator<(
const TargetVertexId& tvi)
const
121 if (m_sourceVx!=tvi.m_sourceVx)
return m_sourceVx<tvi.m_sourceVx;
122 if (m_categ!=tvi.m_categ)
return m_categ<tvi.m_categ;
123 return m_preds<tvi.m_preds;
127 const CostFunction m_costFunction;
128 LinguisticCode m_defaultCateg;
129 std::list<LinguisticCode> m_stopCategories;
130 const Common::PropertyCode::PropertyAccessor* m_microAccessor;
151 void initializeStepDataFromGraph(
154 LinguisticCode startMicro,
155 const std::list< LinguisticCode >& predCats,
157 StepDataVector& stepData)
const;
159 void performViterbiOnStepData(StepDataVector& stepData)
const;
173 StepDataVector& stepData,
174 Common::AnnotationGraphs::AnnotationData* annotationData)
const;
182 virtual std::shared_ptr<MediaProcessUnit>
create(
187 ViterbiPosTaggerFactory(
const std::string&
id);
188 static std::unique_ptr< ViterbiPosTaggerFactory > s_instance;
199#include "ViterbiPosTagger.tcc"
This file is the main header file for the data related to annotation graphs.
A graph structure for linguistic analysis.
LinguisticGraph::vertex_descriptor LinguisticGraphVertex
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, LinguisticVertexProperties > LinguisticGraph
Property to identify the chains in the graph.
#define LIMA_POSTAGGER_EXPORT
Holds all data that pass through the ProcessUnits Analysis data are shared pointers,...
InitializableObjectFactory(const std::string &id)
InitializableObjectManager< MediaProcessUnit, MediaProcessUnitInitializationParameters > Manager
virtual std::shared_ptr< MediaProcessUnit > create(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, MediaProcessUnit::Manager *manager) const override
LimaStatusCode process(AnalysisContent &analysis) const override
Process on data in analysisContent.
ViterbiPosTagger(const CostFunction &costFunction)
void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
virtual ~ViterbiPosTagger()
std::vector< StepData > StepDataVector
std::vector< StepData >::iterator StepDataVectorItr
std::vector< PredData >::iterator PredDataVectorItr
std::map< LinguisticCode, std::vector< PredData > >::iterator MicroCatDataMapItr
std::map< LinguisticCode, std::vector< PredData > > MicroCatDataMap
std::vector< PredData >::const_iterator PredDataVectorCItr
bool operator<(const LinguisticCode &lhs, const LinguisticCode &rhs)
static bool operator<(const QStringView &entityStr, const TextHtmlEntity &entity)
LinguisticCode m_predMicro
launch exception related to the configuration file parsing