mosesdecoder/vw
Marcin Junczys-Dowmunt 685b6574cc verbatim text in readme
2015-01-09 15:05:39 +01:00
..
Classifier.h shared pointer to VW classifiers to correctly call dtors on thread release 2015-01-09 13:39:32 +01:00
ClassifierFactory.cpp shared pointer to VW classifiers to correctly call dtors on thread release 2015-01-09 13:39:32 +01:00
Jamfile replace classifier factory with Marcin's TSS 2015-01-09 11:03:27 +01:00
Normalizer.h destructors 2015-01-09 12:14:17 +01:00
README.md verbatim text in readme 2015-01-09 15:05:39 +01:00
VWPredictor.cpp correct (?) implementations of destructors for VWTrainer and VWPredictor 2015-01-09 11:38:44 +01:00
VWTrainer.cpp shared pointer to VW classifiers to correctly call dtors on thread release 2015-01-09 13:39:32 +01:00

Vowpal Wabbit for Moses

This is an attempt to integrate Vowpal Wabbit with Moses as a stateless feature function.

Implemented classifier features

  • VWFeatureSourceBagOfWords: This create a feature of form bow^token for every source sentence token.
  • VWFeatureSourceExternalFeatures:
  • VWFeatureSourcePhraseInternal:
  • VWFeatureSourceWindow:
  • VWFeatureTargetIndicator:
  • VWFeatureTargetPhraseInternal:

Configuration

To use the classifier edit your moses.ini

[features]
...
VW path=/home/username/vw/classifier1.vw
VWFeatureSourceBagOfWords
VWFeatureTargetIndicator
VWFeatureSourceIndicator
...
 
[weights]
...
VW0= 0.2
...

If you change the name of the main VW feature, remember to tell the VW classifier features which classifier they belong to:

[features]
...
VW name=bart path=/home/username/vw/classifier1.vw 
VWFeatureSourceBagOfWords used-by=bart
VWFeatureTargetIndicator used-by=bart
VWFeatureSourceIndicator used-by=bart
...

[weights]
...
bart= 0.2
...

You can also use multiple classifiers:

[features]
...
VW name=bart path=/home/username/vw/classifier1.vw 
VW path=/home/username/vw/classifier2.vw
VW path=/home/username/vw/classifier3.vw
VWFeatureSourceBagOfWords used-by=bart,VW0 
VWFeatureTargetIndicator used-by=VW1,VW0,bart
VWFeatureSourceIndicator used-by=bart,VW1
...

[weights]
...
bart= 0.2
VW0= 0.2
VW1= 0.2
...

Training the classifier