public ConllXPOSSampleStream(InputStreamFactory in, Charset charset) throws IOException { super(new ParagraphStream(new PlainTextByLineStream(in, charset))); }
/** * Creates a new immutable span based on an existing span, where the existing span did not include the prob * @param span the span that has no prob or the prob is incorrect and a new Span must be generated * @param prob the probability of the span */ public Span(Span span, double prob) { this(span.start, span.end, span.getType(), prob); }
@Override public void close() throws IOException { for (ObjectStream<T> stream : streams) { stream.close(); } }
public void reset() throws IOException, UnsupportedOperationException { input.reset(); } }
/** * Populates the specified array with the probabilities of the last decoded * sequence. The sequence was determined based on the previous call to * <code>chunk</code>. The specified array should be at least as large as the * number of tokens in the previous call to <code>chunk</code>. * * @param probs An array used to hold the probabilities of the last decoded * sequence. */ public void probs(double[] probs) { bestSequence.getProbs(probs); }
/** * Retrieves all parameters without a name space. * * @return the settings map * * @deprecated use {@link #getObjectSettings()} instead */ public Map<String, String> getSettings() { return getSettings(null); }
/** * get a Double parameter * @param key * @param defaultValue * @return */ public double getDoubleParameter(String key, double defaultValue) { return getDoubleParameter(null, key, defaultValue); }
/** * Initializes the current instance. * * @param elements * @param numberOfPartitions */ public CrossValidationPartitioner(Collection<E> elements, int numberOfPartitions) { this(new CollectionObjectStream<>(elements), numberOfPartitions); }
@Override public void reset() throws IOException, UnsupportedOperationException { super.reset(); beginSample = null; } }
/** * get a Boolean parameter * @param key * @param defaultValue * @return */ public boolean getBooleanParameter(String key, boolean defaultValue) { return getBooleanParameter(null, key, defaultValue); }
@Override protected boolean removeEldestEntry(Map.Entry<K,V> eldest) { return this.size() > this.capacity; } }
public ConlluStream(InputStreamFactory in) throws IOException { this.sentenceStream = new ParagraphStream(new PlainTextByLineStream(in, StandardCharsets.UTF_8)); }
@Override public void close() throws IOException { samples.close(); } }
public void reset() throws IOException, UnsupportedOperationException { streamIndex = 0; for (ObjectStream<T> stream : streams) { stream.reset(); } }
/** * Returns an array with the probabilities of the last decoded sequence. The * sequence was determined based on the previous call to <code>chunk</code>. * @return An array with the same number of probabilities as tokens were sent to <code>chunk</code> * when it was last called. */ public double[] probs() { return bestSequence.getProbs(); }
@Override public void close() throws IOException { psi.close(); } }
/** * Populates the specified array with the probabilities of the last decoded sequence. The * sequence was determined based on the previous call to <code>lemmatize</code>. The * specified array should be at least as large as the number of tokens in the * previous call to <code>lemmatize</code>. * * @param probs An array used to hold the probabilities of the last decoded sequence. */ public void probs(double[] probs) { bestSequence.getProbs(probs); }
/** * Returns an array with the probabilities of the last decoded sequence. The * sequence was determined based on the previous call to <code>chunk</code>. * * @return An array with the same number of probabilities as tokens were sent * to <code>chunk</code> when it was last called. */ public double[] probs() { return bestSequence.getProbs(); }