public LBJ2.classify.FeatureVector classify(LBJ2.classify.FeatureVector a0) { if (isClone) { loadInstance(); return instance.classify(a0); } return super.classify(a0); }
public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) { if (isClone) { loadInstance(); return instance.computeLearningRate(a0, a1, a2, a3); } return super.computeLearningRate(a0, a1, a2, a3); }
public void countFeatures(LBJ2.learn.Lexicon.CountPolicy a0) { if (isClone) { loadInstance(); instance.countFeatures(a0); return; } super.countFeatures(a0); }
public LBJ2.learn.Lexicon demandLexicon() { if (isClone) { loadInstance(); return instance.demandLexicon(); } return super.demandLexicon(); }
/** This function shows how to train a ACE coreference classifier using latent structured Perceptron. *See the paper . Kai-Wei Chang, Rajhans Samdani, Alla Rozovskaya, Mark Sammons and Dan Roth. *Illinois-Coref: The UI System in the CoNLL-2012 Shared Task. CoNLL Shared Task, 2012. for details *@param corpusName: path to the corpus files. *@param modelPath: path to the model files. *@param type: can be {pronoun, nonpronoun, all}. pronoun: train the classifier on only pronouns. nonpronoun: train the classifier using only non-pronouns. all: using all mentions. */ @CommandDescription(description = "TrainBestLinkIBTACE corpusName modelFile type") public static void TrainBestLinkIBTACE(String corpusName, String modelFile, String type) throws Exception { DocLoader loader = new DocAPFLoader(corpusName); List<Doc> docs = loader.loadDocs(); //Emnlp8 corefClassifier = new Emnlp8(); aceCorefSPLearner corefClassifier = new aceCorefSPLearner(); corefClassifier.forget(); BestLinkIBT decoder = new BestLinkIBT(corefClassifier, (String)null); if(type.equals("pronoun")){ System.out.println("LEARN ONLY PRONOUN"); //decoder = new BestLinkIBT(new Coref_All()); decoder.learnOnlyPronoun = true; } if(type.equals("nonpronoun")){ System.out.println("LEARN ONLY NONPRONOUN"); decoder.learnOnlyNonPronoun = true; } decoder.setMentionsToConsider(50); TrainIBTSolver(docs, modelFile, decoder); }
Parser testParser = getTestParser(); if (testParserName != null) testParser = LBJ2.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); aceCorefSPLearner classifier = new aceCorefSPLearner(); TestDiscrete tester = new TestDiscrete(); for (int i = 2; i < args.length; ++i) tester.addNull(args[i]); TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0);
public java.lang.String discreteValue(int[] a0, double[] a1) { if (isClone) { loadInstance(); return instance.discreteValue(a0, a1); } return super.discreteValue(a0, a1); }
public void doneWithRound() { if (isClone) { loadInstance(); instance.doneWithRound(); return; } super.doneWithRound(); }
public LBJ2.learn.Learner emptyClone() { if (isClone) { loadInstance(); return instance.emptyClone(); } return super.emptyClone(); }
public void doneLearning() { if (isClone) { loadInstance(); instance.doneLearning(); return; } super.doneLearning(); }
public void demote(int[] a0, double[] a1, double a2) { if (isClone) { loadInstance(); instance.demote(a0, a1, a2); return; } super.demote(a0, a1, a2); }
/** * This function demonstrate how to generate coreference annotation to the documents * @param docs: test data * @param configFile: configuration * @throws Exception */ public static void TestCoref(List<Doc> docs, String configFile) throws Exception{ parseProps(configFile); Parameters.readParams(configFile); Learner corefClassifier = null; Learner pronounClassifier = null; if(AceCorefModel != null) { corefClassifier = new aceCorefSPLearner(AceCorefModel+".lc", AceCorefModel+".lex"); } if(corefClassifier == null) corefClassifier = new aceCorefSPLearner(); //new Emnlp8(); TestPM(corefClassifier, pronounClassifier, docs); }
/** This function shows how to train a ACE coreference classifier using latent structured Perceptron. *See the paper . Kai-Wei Chang, Rajhans Samdani, Alla Rozovskaya, Mark Sammons and Dan Roth. *Illinois-Coref: The UI System in the CoNLL-2012 Shared Task. CoNLL Shared Task, 2012. for details *@param corpusName: path to the corpus files. *@param modelPath: path to the model files. *@param type: can be {pronoun, nonpronoun, all}. pronoun: train the classifier on only pronouns. nonpronoun: train the classifier using only non-pronouns. all: using all mentions. */ @CommandDescription(description = "TrainBestLinkIBTACE corpusName modelFile type") public static void TrainBestLinkIBTACE(String corpusName, String modelFile, String type) throws Exception { DocLoader loader = new DocAPFLoader(corpusName); List<Doc> docs = loader.loadDocs(); //Emnlp8 corefClassifier = new Emnlp8(); aceCorefSPLearner corefClassifier = new aceCorefSPLearner(); corefClassifier.forget(); BestLinkIBT decoder = new BestLinkIBT(corefClassifier, (String)null); if(type.equals("pronoun")){ System.out.println("LEARN ONLY PRONOUN"); //decoder = new BestLinkIBT(new Coref_All()); decoder.learnOnlyPronoun = true; } if(type.equals("nonpronoun")){ System.out.println("LEARN ONLY NONPRONOUN"); decoder.learnOnlyNonPronoun = true; } decoder.setMentionsToConsider(50); TrainIBTSolver(docs, modelFile, decoder); }
Parser testParser = getTestParser(); if (testParserName != null) testParser = LBJ2.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); aceCorefSPLearner classifier = new aceCorefSPLearner(); TestDiscrete tester = new TestDiscrete(); for (int i = 2; i < args.length; ++i) tester.addNull(args[i]); TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0);
public java.lang.String discreteValue(LBJ2.classify.FeatureVector a0) { if (isClone) { loadInstance(); return instance.discreteValue(a0); } return super.discreteValue(a0); }
public LBJ2.learn.Lexicon demandLexicon() { if (isClone) { loadInstance(); return instance.demandLexicon(); } return super.demandLexicon(); }
public void doneWithRound() { if (isClone) { loadInstance(); instance.doneWithRound(); return; } super.doneWithRound(); }
public LBJ2.learn.Learner emptyClone() { if (isClone) { loadInstance(); return instance.emptyClone(); } return super.emptyClone(); }
public void doneLearning() { if (isClone) { loadInstance(); instance.doneLearning(); return; } super.doneLearning(); }
public void demote(int[] a0, double[] a1, double a2) { if (isClone) { loadInstance(); instance.demote(a0, a1, a2); return; } super.demote(a0, a1, a2); }