Uploaded image for project: 'OpenNLP'
  1. OpenNLP
  2. OPENNLP-1308

Incorrect code snippet in Name Finder Training -> Training Api

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 1.9.4
    • 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);
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            sln2 Mikalai Dudko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: