import it.uniroma1.lcl.jlt.util.Language; import it.uniroma1.lcl.wcl.data.dataset.AnnotatedDataset; import it.uniroma1.lcl.wcl.data.dataset.Dataset; import it.uniroma1.lcl.wcl.data.sentence.Sentence; import it.uniroma1.lcl.wcl.classifiers.lattice.TripleLatticeClassifier; import it.uniroma1.lcl.wcl.classifiers.lattice.WCLClassifier; import it.uniroma1.lcl.wcl.data.sentence.SentenceAnnotation; import java.io.IOException; public class Test { public static void main(String[] args) { // select the language of interest Language targetLanguage = Language.EN; String trainingDatasetFile ="data/training/wiki_good.EN.html"; Dataset ts; // open the training set try { // load the training set for the target language ts = new AnnotatedDataset(trainingDatasetFile, targetLanguage); // obtain an instance of the WCL classifier WCLClassifier c = new TripleLatticeClassifier(targetLanguage); c.train(ts); // create a sentence to be tested Sentence sentence = Sentence.createFromString("WCL", "WCL is a classifier.", targetLanguage); // test the sentence SentenceAnnotation sa = c.test(sentence); // print the hypernym if (sa.isDefinition()) System.out.println(sa.getHyper()); } catch (IOException e) { e.printStackTrace(); } } }
Roberto Navigli, Paola Velardi. Learning Word-Class Lattices for Definition and Hypernym Extraction. Proc. of the 48th Annual Meeting of the Association for Computational Linguistics (ACL 2010), Uppsala, Sweden, July 11-16, 2010, pp. 1318-1327 |
Roberto Navigli, Paola Velardi, Juana María Ruiz-Martínez. An Annotated Dataset for Extracting Definitions and Hypernyms from the Web. Proc. of LREC 2010, Valletta, Malta, May 19-21, 2010, pp. 3716-3722 |
Stefano Faralli, Roberto Navigli. A Java Framework for Multilingual Definition and Hypernym Extraction. Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics: System Demonstrations, Sofia, Bulgaria, August 4-9, pp. 103-108. |