Skip to content

Commit

Permalink
#434 - renamed classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Horsmann committed Feb 5, 2018
1 parent 045b5fa commit f05aa08
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import org.dkpro.tc.core.util.TaskUtils;
import org.dkpro.tc.ml.uima.TcAnnotator;

public abstract class LibsvmModelLoaderConnector
public abstract class LibsvmDataFormatLoadModelConnector
extends ModelSerialization_ImplBase
{

Expand All @@ -65,8 +65,6 @@ public abstract class LibsvmModelLoaderConnector
@ConfigurationParameter(name = PARAM_LEARNING_MODE, mandatory = true)
protected String learningMode;

// private svm_model model;

protected Map<String, String> integer2OutcomeMapping;
protected Map<String, Integer> featureMapping;

Expand All @@ -77,8 +75,6 @@ public void initialize(UimaContext context)
super.initialize(context);

try {
// model = svm
// .svm_load_model(new File(tcModelLocation, MODEL_CLASSIFIER).getAbsolutePath());
integer2OutcomeMapping = loadInteger2OutcomeMapping(tcModelLocation);
featureMapping = loadFeature2IntegerMapping(tcModelLocation);
SaveModelUtils.verifyTcVersion(tcModelLocation, getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.dkpro.tc.core.Constants;
import org.dkpro.tc.core.task.ModelSerializationTask;

public abstract class LibsvmModelSerialization extends ModelSerializationTask implements Constants {
public abstract class LibsvmDataFormatSerializeModelConnector extends ModelSerializationTask implements Constants {

@Discriminator(name = DIM_CLASSIFICATION_ARGS)
protected List<String> classificationArguments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import org.dkpro.tc.core.Constants;
import org.dkpro.tc.core.util.SaveModelUtils;
import org.dkpro.tc.io.libsvm.LibsvmModelSerialization;
import org.dkpro.tc.io.libsvm.LibsvmDataFormatSerializeModelConnector;
import org.dkpro.tc.ml.liblinear.LiblinearAdapter;
import org.dkpro.tc.ml.liblinear.util.LiblinearUtils;

Expand All @@ -32,7 +32,7 @@
import de.bwaldvogel.liblinear.Problem;
import de.bwaldvogel.liblinear.SolverType;

public class LiblinearModelSerializationDescription extends LibsvmModelSerialization implements Constants {
public class LiblinearModelSerializationDescription extends LibsvmDataFormatSerializeModelConnector implements Constants {

boolean trainModel = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@

import org.apache.uima.UimaContext;
import org.apache.uima.resource.ResourceInitializationException;
import org.dkpro.tc.io.libsvm.LibsvmModelLoaderConnector;
import org.dkpro.tc.io.libsvm.LibsvmDataFormatLoadModelConnector;

import de.bwaldvogel.liblinear.Feature;
import de.bwaldvogel.liblinear.Linear;
import de.bwaldvogel.liblinear.Model;
import de.bwaldvogel.liblinear.Problem;

public class LoadModelConnectorLiblinear extends LibsvmModelLoaderConnector {
public class LoadModelConnectorLiblinear extends LibsvmDataFormatLoadModelConnector {

private Model liblinearModel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

import org.dkpro.tc.core.Constants;
import org.dkpro.tc.core.util.SaveModelUtils;
import org.dkpro.tc.io.libsvm.LibsvmModelSerialization;
import org.dkpro.tc.io.libsvm.LibsvmDataFormatSerializeModelConnector;
import org.dkpro.tc.ml.libsvm.LibsvmAdapter;
import org.dkpro.tc.ml.libsvm.api.LibsvmTrainModel;

public class LibsvmModelSerializationDescription extends LibsvmModelSerialization implements Constants {
public class LibsvmModelSerializationDescription extends LibsvmDataFormatSerializeModelConnector implements Constants {

@Override
protected void trainModel(File fileTrain) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
import org.apache.uima.UimaContext;
import org.apache.uima.pear.util.FileUtil;
import org.apache.uima.resource.ResourceInitializationException;
import org.dkpro.tc.io.libsvm.LibsvmModelLoaderConnector;
import org.dkpro.tc.io.libsvm.LibsvmDataFormatLoadModelConnector;
import org.dkpro.tc.ml.libsvm.api.LibsvmPredict;

import libsvm.svm;
import libsvm.svm_model;

public class LoadModelConnectorLibsvm extends LibsvmModelLoaderConnector {
public class LoadModelConnectorLibsvm extends LibsvmDataFormatLoadModelConnector {

private svm_model model;

Expand Down

0 comments on commit f05aa08

Please sign in to comment.