Package edu.stanford.nlp.pipeline

Examples of edu.stanford.nlp.pipeline.ProtobufAnnotationSerializer


      System.out.println(d.get("sentid"));
    }
  }

  private List<CoreLabel> readProtoBufAnnotation(byte[] sent) throws IOException {
    ProtobufAnnotationSerializer p = new ProtobufAnnotationSerializer();
    List<CoreLabel> toks = new ArrayList<CoreLabel>();
    ByteArrayInputStream is = new ByteArrayInputStream(sent);
    CoreNLPProtos.Token d;
    do{
      d = CoreNLPProtos.Token.parseDelimitedFrom(is);
      if(d != null)
        toks.add(p.fromProto(d));
    } while(d != null);
    return toks;
  }
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.pipeline.ProtobufAnnotationSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.