GateNLP / gateplugin-LearningFramework

A plugin for the GATE language technology framework for training and using machine learning models. Currently supports Mallet (MaxEnt, NaiveBayes, CRF and others), LibSVM, Scikit-Learn, Weka, and DNNs through Pytorch and Keras.
https://gatenlp.github.io/gateplugin-LearningFramework/
GNU Lesser General Public License v2.1
26 stars 6 forks source link

Add feature functions that can depend on the target #48

Open johann-petrak opened 7 years ago

johann-petrak commented 7 years ago

Allow features to depend on (previous) targets. This means we should be able to add something like <CLASS>-2</CLASS> to an ATTRIBUTE or ATTRIBUTELIST declaration and then use the value that results from combining the actual value and the class value. For attributelist declarations the maximum effective class index must always be to the left of the current index, e.g. for a list going from -2 to +2 we either have to refer to class index -3 or if e.g. we refer to class index -1 we only generate the feature for indices -2 to 0.

Initially the actual feature function will be implicit: just concatenate the value and the class using a special concat symbol.

Actual feature functions will need to get implemented separately, ideally we could do something like <FUNCTION>the.java.class.path.of.a.Class</FUNCTION> where that class implements a specific interface for calculating something (the value, and maybe also a feature specification: needs to implement getValue(featureValue,targetValue) and getFeatureSpec()).