public AbstractNLPDecoder(InputStream configuration) { init(new DecodeConfig(configuration)); }
public N[] toNodeArray(List<Token> tokens) { return toNodeArray(tokens, t -> create(t)); }
public TSVReader<N> createTSVReader() { return new TSVReader<N>(decode_config.getReaderFieldMap()) { @Override protected N create() {return AbstractNLPDecoder.this.create();} }; }
public void initComponents() { Element eModels = XMLUtils.getFirstElementByTagName(xml, "models"); setPartOfSpeechTagging (XMLUtils.getTextContentFromFirstElementByTagName(eModels, "pos")); setNamedEntityRecognition(XMLUtils.getTextContentFromFirstElementByTagName(eModels, "ner")); setDependencyParsing (XMLUtils.getTextContentFromFirstElementByTagName(eModels, "dep")); setSemanticRoleLabeling (XMLUtils.getTextContentFromFirstElementByTagName(eModels, "srl")); }
public void decode(InputStream in, OutputStream out, String format) { try { switch (format) { case FORMAT_RAW : decodeRaw (in, out); break; case FORMAT_LINE: decodeLine(in, out); break; case FORMAT_TSV : decodeTSV (createTSVReader(), in, out); break; } } catch (Exception e) {e.printStackTrace();} }
public N[] decode(String sentence) { List<Token> tokens = tokenizer.tokenize(sentence); return decode(toNodeArray(tokens)); }
public CSVSentiment(String configurationFile) { decode = new NLPDecoder(IOUtils.createFileInputStream(configurationFile)); }
public NLPDecoder(InputStream configuration) { super(new DecodeConfig(configuration)); }
public DecodeConfig(InputStream in) { super(in); initComponents(); }
@Override protected N create() {return AbstractNLPDecoder.this.create();} };
public AbstractNLPDecoder(DecodeConfig config) { init(config); }
public NLPNode create(ItToken token) { NLPNode node = decoder.create(token); node.setFeatMap(token.feat); return node; }
public void initComponents() { Element eModels = XMLUtils.getFirstElementByTagName(xml, "models"); setPartOfSpeechTagging (XMLUtils.getTextContentFromFirstElementByTagName(eModels, "pos")); setNamedEntityRecognition(XMLUtils.getTextContentFromFirstElementByTagName(eModels, "ner")); setDependencyParsing (XMLUtils.getTextContentFromFirstElementByTagName(eModels, "dep")); setSemanticRoleLabeling (XMLUtils.getTextContentFromFirstElementByTagName(eModels, "srl")); }
public AbstractNLPDecoder(InputStream configuration) { init(new DecodeConfig(configuration)); }
public N[] toNodeArray(List<Token> tokens) { return toNodeArray(tokens, t -> create(t)); }
public N[] decode(String sentence) { List<Token> tokens = tokenizer.tokenize(sentence); return decode(toNodeArray(tokens)); }
public NLPDecoder(InputStream configuration) { super(new DecodeConfig(configuration)); }
public DecodeConfig(InputStream in) { super(in); initComponents(); }
@Override protected N create() {return AbstractNLPDecoder.this.create();} };
public AbstractNLPDecoder(DecodeConfig config) { init(config); }