Codota Logo
ComparableEvent
Code IndexAdd Codota to your IDE (free)

How to use
ComparableEvent
in
opennlp.tools.ml.model

Best Java code snippets using opennlp.tools.ml.model.ComparableEvent (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: apache/opennlp

protected List<ComparableEvent> index(ObjectStream<Event> events,
                   Map<String, Integer> predicateIndex) throws IOException {
 Map<String, Integer> omap = new HashMap<>();
 List<ComparableEvent> eventsToCompare = new ArrayList<>();
 Event ev;
 while ((ev = events.read()) != null) {
  omap.putIfAbsent(ev.getOutcome(), omap.size());
  int[] cons = Arrays.stream(ev.getContext())
    .map(pred -> predicateIndex.get(pred))
    .filter(Objects::nonNull)
    .mapToInt(i -> i).toArray();
  // drop events with no active features
  if (cons.length > 0) {
   int ocID = omap.get(ev.getOutcome());
   eventsToCompare.add(new ComparableEvent(ocID, cons, ev.getValues()));
  } else {
   display("Dropped event " + ev.getOutcome() + ":"
     + Arrays.asList(ev.getContext()) + "\n");
  }
 }
 outcomeLabels = toIndexedStringArray(omap);
 predLabels = toIndexedStringArray(predicateIndex);
 return eventsToCompare;
}
origin: apache/opennlp

ComparableEvent ce2 = eventsToCompare.get(i);
if (ce.compareTo(ce2) == 0) {
origin: ai.idylnlp/idylnlp-opennlp-tools-1.8.3

protected List<ComparableEvent> index(ObjectStream<Event> events,
                   Map<String, Integer> predicateIndex) throws IOException {
 Map<String, Integer> omap = new HashMap<>();
 List<ComparableEvent> eventsToCompare = new ArrayList<>();
 Event ev;
 while ((ev = events.read()) != null) {
  omap.putIfAbsent(ev.getOutcome(), omap.size());
  int[] cons = Arrays.stream(ev.getContext())
    .map(pred -> predicateIndex.get(pred))
    .filter(Objects::nonNull)
    .mapToInt(i -> i).toArray();
  // drop events with no active features
  if (cons.length > 0) {
   int ocID = omap.get(ev.getOutcome());
   eventsToCompare.add(new ComparableEvent(ocID, cons, ev.getValues()));
  } else {
   display("Dropped event " + ev.getOutcome() + ":"
     + Arrays.asList(ev.getContext()) + "\n");
  }
 }
 outcomeLabels = toIndexedStringArray(omap);
 predLabels = toIndexedStringArray(predicateIndex);
 return eventsToCompare;
}
origin: org.apache.opennlp/opennlp-tools

ComparableEvent ce2 = eventsToCompare.get(i);
if (ce.compareTo(ce2) == 0) {
origin: edu.usc.ir/age-predictor-opennlp

  cons[ci] = indexedContext.get(ci);
ce = new ComparableEvent(ocID, cons);
eventsToCompare.add(ce);
origin: ai.idylnlp/idylnlp-opennlp-tools-1.8.3

ComparableEvent ce2 = eventsToCompare.get(i);
if (ce.compareTo(ce2) == 0) {
origin: org.apache.opennlp/opennlp-tools

protected List<ComparableEvent> index(ObjectStream<Event> events,
                   Map<String, Integer> predicateIndex) throws IOException {
 Map<String, Integer> omap = new HashMap<>();
 List<ComparableEvent> eventsToCompare = new ArrayList<>();
 Event ev;
 while ((ev = events.read()) != null) {
  omap.putIfAbsent(ev.getOutcome(), omap.size());
  int[] cons = Arrays.stream(ev.getContext())
    .map(pred -> predicateIndex.get(pred))
    .filter(Objects::nonNull)
    .mapToInt(i -> i).toArray();
  // drop events with no active features
  if (cons.length > 0) {
   int ocID = omap.get(ev.getOutcome());
   eventsToCompare.add(new ComparableEvent(ocID, cons, ev.getValues()));
  } else {
   display("Dropped event " + ev.getOutcome() + ":"
     + Arrays.asList(ev.getContext()) + "\n");
  }
 }
 outcomeLabels = toIndexedStringArray(omap);
 predLabels = toIndexedStringArray(predicateIndex);
 return eventsToCompare;
}
opennlp.tools.ml.modelComparableEvent

Javadoc

A maxent event representation which we can use to sort based on the predicates indexes contained in the events.

Most used methods

  • <init>
  • compareTo

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Table (org.hibernate.mapping)
    A relational table
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now