Details
-
Documentation
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
None
-
None
-
None
Description
Manual -> Name Finder Training -> Training Api section -> TokenNameFinderFactory and modelOut
ObjectStream<String> lineStream = new PlainTextByLineStream(new FileInputStream("en-ner-person.train"), StandardCharsets.UTF_8); TokenNameFinderModel model; try (ObjectStream<NameSample> sampleStream = new NameSampleDataStream(lineStream)) { model = NameFinderME.train("en", "person", sampleStream, TrainingParameters.defaultParams(), TokenNameFinderFactory nameFinderFactory); } try (modelOut = new BufferedOutputStream(new FileOutputStream(modelFile)){ model.serialize(modelOut); }