Skip to content

Removed label from count features #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/edu/jhu/thrax/hadoop/features/mapred/SourceCountFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,10 @@
public class SourceCountFeature extends MapReduceFeature {

public static final String NAME = "f_count";
public static final String LABEL = "C(f)";

public String getName() {
return NAME;
}

public String getLabel() {
return LABEL;
}

public Class<? extends WritableComparator> sortComparatorClass() {
return Comparator.class;
Expand Down Expand Up @@ -99,7 +94,7 @@ protected void reduce(RuleWritable key, Iterable<IntWritable> values, Context co
if (key.lhs == PrimitiveUtils.MARGINAL_ID) {
return;
}
context.write(key, new FeaturePair(Vocabulary.id(LABEL), sourceCount));
context.write(key, new FeaturePair(Vocabulary.id(NAME), sourceCount));
}

}
Expand Down Expand Up @@ -140,10 +135,10 @@ public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
private static final FloatWritable ZERO = new FloatWritable(0.0f);

public void unaryGlueRuleScore(int nt, java.util.Map<Integer, Writable> map) {
map.put(Vocabulary.id(LABEL), ZERO);
map.put(Vocabulary.id(NAME), ZERO);
}

public void binaryGlueRuleScore(int nt, java.util.Map<Integer, Writable> map) {
map.put(Vocabulary.id(LABEL), ZERO);
map.put(Vocabulary.id(NAME), ZERO);
}
}
11 changes: 3 additions & 8 deletions src/edu/jhu/thrax/hadoop/features/mapred/TargetCountFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,11 @@
public class TargetCountFeature extends MapReduceFeature {

public static final String NAME = "e_count";
public static final String LABEL = "C(e)";

public String getName() {
return NAME;
}

public String getLabel() {
return LABEL;
}

public Class<? extends WritableComparator> sortComparatorClass() {
return Comparator.class;
}
Expand Down Expand Up @@ -98,7 +93,7 @@ protected void reduce(RuleWritable key, Iterable<IntWritable> values, Context co
if (key.lhs == PrimitiveUtils.MARGINAL_ID) {
return;
}
context.write(key, new FeaturePair(Vocabulary.id(LABEL), targetCount));
context.write(key, new FeaturePair(Vocabulary.id(NAME), targetCount));
}

}
Expand Down Expand Up @@ -139,10 +134,10 @@ public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
private static final FloatWritable ZERO = new FloatWritable(0.0f);

public void unaryGlueRuleScore(int nt, java.util.Map<Integer, Writable> map) {
map.put(Vocabulary.id(LABEL), ZERO);
map.put(Vocabulary.id(NAME), ZERO);
}

public void binaryGlueRuleScore(int nt, java.util.Map<Integer, Writable> map) {
map.put(Vocabulary.id(LABEL), ZERO);
map.put(Vocabulary.id(NAME), ZERO);
}
}