@Test public void testBracketStyle() throws IOException { Path p = TestUtil.tempFileWithData( "[ABC Foo Bar] ivir zivir [DEF haha] . "); NerDataSet set = NerDataSet.load(p, AnnotationStyle.BRACKET); System.out.println("types= " + set.types); Assert.assertTrue(TestUtil.containsAll(set.types, "ABC", "DEF", "OUT")); }
public static NerDataSet load(Path path, AnnotationStyle style) throws IOException { switch (style) { case BRACKET: return loadBracketStyle(path); case ENAMEX: return loadEnamexStyle(path); case OPEN_NLP: return loadOpenNlpStyle(path); } throw new IOException(String.format("Cannot load data from %s with style %s", path, style)); }
NerDataSet { public static NerDataSet load(Path path, AnnotationStyle style) throws IOException { switch (style) { case BRACKET: return loadBracketStyle(path); case ENAMEX: return loadEnamexStyle(path); case OPEN_NLP: return loadOpenNlpStyle(path); } throw new IOException(String.format("Cannot load data from %s with style %s", path, style)); } }
NerDataSet { public static NerDataSet load(Path path, AnnotationStyle style) throws IOException { switch (style) { case BRACKET: return loadBracketStyle(path); case ENAMEX: return loadEnamexStyle(path); case OPEN_NLP: return loadOpenNlpStyle(path); } throw new IOException(String.format("Cannot load data from %s with style %s", path, style)); } NerDataSet(List<NerSentence> sentences); }
NerDataSet { public static NerDataSet load(Path path, AnnotationStyle style) throws IOException { switch (style) { case BRACKET: return loadBracketStyle(path); case ENAMEX: return loadEnamexStyle(path); case OPEN_NLP: return loadOpenNlpStyle(path); } throw new IOException(String.format("Cannot load data from %s with style %s", path, style)); } NerDataSet(List<NerSentence> sentences); List<NerSentence> getSentences(); void shuffle(); static NerDataSet load(Path path, AnnotationStyle style); static String normalizeForNer(String input); void addSet(NerDataSet set); NerDataSet getSubSet(int from, int to); String info(); }
NerDataSet { public static NerDataSet load(Path path, AnnotationStyle style) throws IOException { switch (style) { case BRACKET: return loadBracketStyle(path); case ENAMEX: return loadEnamexStyle(path); case OPEN_NLP: return loadOpenNlpStyle(path); } throw new IOException(String.format("Cannot load data from %s with style %s", path, style)); } NerDataSet(List<NerSentence> sentences); List<NerSentence> getSentences(); void shuffle(); static NerDataSet load(Path path, AnnotationStyle style); static String normalizeForNer(String input); void addSet(NerDataSet set); NerDataSet getSubSet(int from, int to); String info(); static final String OUT_TOKEN_TYPE; }