use of zemberek.ner.NamedEntity in project zemberek-nlp by ahmetaa.
the class UseNer method main.
public static void main(String[] args) throws IOException {
// assumes you generated a model in my-model directory.
Path modelRoot = Paths.get("my-model");
TurkishMorphology morphology = TurkishMorphology.createWithDefaults();
PerceptronNer ner = PerceptronNer.loadModel(modelRoot, morphology);
String sentence = "Ali Kaan yarın İstanbul'a gidecek.";
NerSentence result = ner.findNamedEntities(sentence);
List<NamedEntity> namedEntities = result.getNamedEntities();
for (NamedEntity namedEntity : namedEntities) {
System.out.println(namedEntity);
}
}
Aggregations