Commit bd65e3d1 authored by Markus Krug's avatar Markus Krug
Browse files

update

parent c9130927
......@@ -5,7 +5,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
......@@ -20,13 +19,10 @@ import java.util.stream.Collector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.uniwue.ls6.algorithm.datastructure.RepresentationRule;
import de.uniwue.ls6.datastructure.Instance;
import de.uniwue.ls6.datastructure.LabelAlphabet;
import de.uniwue.ls6.datastructure.MatrixMapping;
import de.uniwue.ls6.datastructure.MatrixMcMatrixFace;
import no.uib.cipr.matrix.Matrices;
import no.uib.cipr.matrix.MatrixEntry;
import no.uib.cipr.matrix.sparse.FlexCompColMatrix;
......
......@@ -38,7 +38,8 @@ public class InListFeatureGenerator extends AFeatureGenerator {
public String[] generateFeatures(AnnotationFS token) {
if(listEntries.contains(token.getCoveredText())){
return new String[]{super.featureIdentifier+"=IN_LIST" };
String id = token.getCoveredText().substring(0,Math.min(2, token.getCoveredText().length()));
return new String[]{super.featureIdentifier+id+"=IN_LIST" };
}
return new String[]{super.featureIdentifier+"=NOT_IN_LIST" };
}
......
......@@ -256,9 +256,12 @@ public class BinaryRepresentationRuleLearningAlgorithm implements IRepresentatio
if (maxEntryLocation == null)
break;
// map matrix to dense matrix
long time = System.currentTimeMillis();
MatrixMapping mappingForMaximum = MatrixUtil.getMappingForMaximum(iterationMatrix, maximumScore,
maxEntryLocation.getLocation(), mappings, indexMap, beamSize);
mappings.add(mappingForMaximum);
System.out.println(System.currentTimeMillis()-time);
time = System.currentTimeMillis();
// assert that the maximum is within bounds
assert (maxEntryLocation == null ? true
......@@ -266,7 +269,6 @@ public class BinaryRepresentationRuleLearningAlgorithm implements IRepresentatio
.getY() < iterationMatrix.getTpMatrix().numRows()) : "Position of maximum out of bounds";
// expand in kronecker fashion
long time = System.currentTimeMillis();
iterationMatrix = MatrixUtil.performKroneckerExpansion(mappings, instances, goldLabel);
System.out.println(System.currentTimeMillis() - time);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment