Skip to content

Deprecated old gazetter View Generator. Also incremented minor version number. #244

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

Merged
merged 4 commits into from
Oct 17, 2016
Merged
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
4 changes: 2 additions & 2 deletions big-data-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -23,7 +23,7 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-core-utilities</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>org.xeustechnologies.google-api</groupId>
Expand Down
8 changes: 4 additions & 4 deletions chunker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -13,7 +13,7 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-core-utilities</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>

<dependency>
Expand All @@ -24,12 +24,12 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>LBJava-NLP-tools</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-pos</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
Expand Down
2 changes: 1 addition & 1 deletion core-utilities/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
6 changes: 3 additions & 3 deletions corpusreaders/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -15,12 +15,12 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-core-utilities</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-tokenizer</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
4 changes: 2 additions & 2 deletions curator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,7 +15,7 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-core-utilities</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>

<!-- Curator-related dependencies -->
Expand Down
8 changes: 4 additions & 4 deletions edison/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,7 +15,7 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-core-utilities</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
Expand All @@ -26,13 +26,13 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-corpusreaders</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<!-- Used only in utilities.CreateTestTAResource -->
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-curator</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
<scope>test</scope>
</dependency>
<!-- Used only in features.FeatureUtilities to convert to LBJava-based feature vectors -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.zip.GZIPInputStream;

/**
* Use SimpleGazetteerAnnotator instead
* Use this class to create a gazetteer view for your text.
*
* Use this in combination with cogcomp-common-resources, and pass in
Expand All @@ -47,6 +48,7 @@
*
* @author Vivek Srikumar
*/
@Deprecated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment that "instead of this you should use SimpleGazetteerAnnotator"?

public class GazetteerViewGenerator extends Annotator {
public static final GazetteerViewGenerator gazetteersInstance, cbcInstance;
private static final Logger log = LoggerFactory.getLogger(GazetteerViewGenerator.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @author redman
*/
public class SimpleGazetteerAnnotator extends Annotator {

// ? should this not have a viewName?
/** this hash tree contains the terms as exactly as they are. */
ArrayList<GazetteerTree> dictionaries;
/** this hash tree contains the terms in lowercase. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation;
import edu.illinois.cs.cogcomp.core.io.IOUtils;
import edu.illinois.cs.cogcomp.core.io.LineIO;
import edu.illinois.cs.cogcomp.edison.annotators.GazetteerViewGenerator;
import edu.illinois.cs.cogcomp.edison.annotators.SimpleGazetteerAnnotator;
import edu.illinois.cs.cogcomp.edison.features.*;
import edu.illinois.cs.cogcomp.edison.features.factory.WordNetFeatureExtractor.WordNetFeatureClass;
import edu.illinois.cs.cogcomp.edison.features.helpers.WordHelpers;
Expand Down Expand Up @@ -406,7 +406,7 @@ private static Set<Feature> getConditionalFeature(boolean condition, Feature...
}

public static WordFeatureExtractor getGazetteerFeatureExtractor(final String name,
final GazetteerViewGenerator gazetteerViewGenerator) {
final SimpleGazetteerAnnotator gazetteerViewGenerator) {

if (!gazetteerFeatureExtractors.containsKey(name)) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package edu.illinois.cs.cogcomp.edison.features.manifest;

import edu.illinois.cs.cogcomp.core.datastructures.textannotation.Constituent;
import edu.illinois.cs.cogcomp.edison.annotators.GazetteerViewGenerator;
import edu.illinois.cs.cogcomp.edison.features.CurrencyIndicator;
import edu.illinois.cs.cogcomp.edison.features.DiscreteFeature;
import edu.illinois.cs.cogcomp.edison.features.Feature;
Expand Down Expand Up @@ -102,11 +101,11 @@ public Set<Feature> getFeatures(Constituent c) throws EdisonException {
fexes.put("brown-clusters-1000", BrownClusterFeatureExtractor.instance1000);
fexes.put("brown-clusters-3200", BrownClusterFeatureExtractor.instance3200);

fexes.put("gazetteers", WordFeatureExtractorFactory.getGazetteerFeatureExtractor(
"gazetteers", GazetteerViewGenerator.gazetteersInstance));

fexes.put("cbc", WordFeatureExtractorFactory.getGazetteerFeatureExtractor("cbc",
GazetteerViewGenerator.gazetteersInstance));
// fexes.put("gazetteers", WordFeatureExtractorFactory.getGazetteerFeatureExtractor(
// "gazetteers", GazetteerViewGenerator.gazetteersInstance));
//
// fexes.put("cbc", WordFeatureExtractorFactory.getGazetteerFeatureExtractor("cbc",
// GazetteerViewGenerator.gazetteersInstance));

fexes.put("CORLEX", CorlexFeatureExtractor.instance);
fexes.put("roget-thesaurus", RogetThesaurusFeatures.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,17 @@ public final void testFeatureCollection() throws Exception {
}
}
}

public final void testGazetteerFeatures() throws Exception {
System.out.println("\tTesting gazetteer features");
WordFeatureExtractor fex =
WordFeatureExtractorFactory.getGazetteerFeatureExtractor("gazetteer",
new GazetteerViewGenerator("gazetteers", ViewNames.GAZETTEER));

for (TextAnnotation ta : tas) {
runTest(ta, fex);
}
}
// Not needed anymore, as test of SimpleGazetteerAnnotator in SimpleGazetteerAnnotatorTest.java suffice.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they are testing slightly different things. The test for SimpleGazetteerAnnotatorTest is testing its functionality directly. While this is testing correct functionality of SimpleGazetteerAnnotatorTest inside WordFeatureExtractorFactory.
What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know why Vivek did not separate the test class, but it is reasonable. After all, gazetteers are used for features right? The tests are checking the same feature, just the organization of the test code is different.

// public final void testGazetteerFeatures() throws Exception {
// System.out.println("\tTesting gazetteer features");
// WordFeatureExtractor fex =
// WordFeatureExtractorFactory.getGazetteerFeatureExtractor("gazetteer",
// new GazetteerViewGenerator("gazetteers", ViewNames.GAZETTEER));
//
// for (TextAnnotation ta : tas) {
// runTest(ta, fex);
// }
// }

private void runTest(TextAnnotation ta, WordFeatureExtractor fex) throws EdisonException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
*/
package edu.illinois.cs.cogcomp.edison.utilities;

import edu.illinois.cs.cogcomp.core.datastructures.ViewNames;
import edu.illinois.cs.cogcomp.core.datastructures.textannotation.Constituent;
import edu.illinois.cs.cogcomp.core.datastructures.textannotation.TextAnnotation;
import edu.illinois.cs.cogcomp.core.io.IOUtils;
import edu.illinois.cs.cogcomp.edison.annotators.GazetteerViewGenerator;
import edu.illinois.cs.cogcomp.edison.annotators.SimpleGazetteerAnnotator;
import edu.illinois.cs.cogcomp.edison.features.Feature;
import edu.illinois.cs.cogcomp.edison.features.FeatureCollection;
import edu.illinois.cs.cogcomp.edison.features.WordFeatureExtractor;
Expand Down Expand Up @@ -181,7 +180,7 @@ private void addGazetteerFeatures() throws Exception {
System.out.println("\tadding gazetteer features");
WordFeatureExtractor fex =
WordFeatureExtractorFactory.getGazetteerFeatureExtractor("gazetteer",
new GazetteerViewGenerator("gazetteers", ViewNames.GAZETTEER));
new SimpleGazetteerAnnotator());

for (TextAnnotation ta : tas) {
addFeatures(ta, fex);
Expand Down
4 changes: 2 additions & 2 deletions lbjava-nlp-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-core-utilities</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
</dependencies>

Expand Down
6 changes: 3 additions & 3 deletions lemmatizer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,12 +15,12 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-core-utilities</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-edison</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
Expand Down
8 changes: 4 additions & 4 deletions ner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -23,12 +23,12 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-tokenizer</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-core-utilities</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<!-- Contains the gazetteers and Brown clusters -->
<dependency>
Expand All @@ -44,7 +44,7 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>LBJava-NLP-tools</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>

<!-- models: you need to use/specify a new path to avoid using these -->
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-cogcomp-nlp</artifactId>
<packaging>pom</packaging>
<version>3.0.77</version>
<version>3.0.78</version>

<modules>
<module>core-utilities</module>
Expand Down
6 changes: 3 additions & 3 deletions pos/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -13,7 +13,7 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-core-utilities</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>

<dependency>
Expand All @@ -24,7 +24,7 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>LBJava-NLP-tools</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
Expand Down
8 changes: 4 additions & 4 deletions tokenizer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>illinois-cogcomp-nlp</artifactId>
<groupId>edu.illinois.cs.cogcomp</groupId>
<version>3.0.77</version>
<version>3.0.78</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,17 +15,17 @@
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-core-utilities</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>LBJava-NLP-tools</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
</dependency>
<dependency>
<groupId>edu.illinois.cs.cogcomp</groupId>
<artifactId>illinois-curator</artifactId>
<version>3.0.77</version>
<version>3.0.78</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down