Search in sources :

Example 11 with SceneGraphImageRelationship

use of edu.stanford.nlp.scenegraph.image.SceneGraphImageRelationship in project CoreNLP by stanfordnlp.

the class SceneGraphImageFilter method countAll.

private static void countAll(List<SceneGraphImage> images) {
    for (SceneGraphImage img : images) {
        for (SceneGraphImageAttribute attr : img.attributes) {
            entityCounter.incrementCount(attr.subjectLemmaGloss());
            attributeCounter.incrementCount(attr.attributeLemmaGloss());
        }
        for (SceneGraphImageRelationship attr : img.relationships) {
            entityCounter.incrementCount(attr.subjectLemmaGloss());
            relationCounter.incrementCount(attr.predicateLemmaGloss());
            entityCounter.incrementCount(attr.objectLemmaGloss());
        }
    }
}
Also used : SceneGraphImageRelationship(edu.stanford.nlp.scenegraph.image.SceneGraphImageRelationship) SceneGraphImage(edu.stanford.nlp.scenegraph.image.SceneGraphImage) SceneGraphImageAttribute(edu.stanford.nlp.scenegraph.image.SceneGraphImageAttribute)

Aggregations

SceneGraphImageAttribute (edu.stanford.nlp.scenegraph.image.SceneGraphImageAttribute)11 SceneGraphImageRelationship (edu.stanford.nlp.scenegraph.image.SceneGraphImageRelationship)11 SceneGraphImage (edu.stanford.nlp.scenegraph.image.SceneGraphImage)5 SceneGraphImageRegion (edu.stanford.nlp.scenegraph.image.SceneGraphImageRegion)5 SceneGraphImageObject (edu.stanford.nlp.scenegraph.image.SceneGraphImageObject)3 Triple (edu.stanford.nlp.util.Triple)3 BufferedReader (java.io.BufferedReader)3 CoreAnnotations (edu.stanford.nlp.ling.CoreAnnotations)2 CoreLabel (edu.stanford.nlp.ling.CoreLabel)2 Annotation (edu.stanford.nlp.pipeline.Annotation)2 StanfordCoreNLP (edu.stanford.nlp.pipeline.StanfordCoreNLP)2 ClassicCounter (edu.stanford.nlp.stats.ClassicCounter)2 CoreMap (edu.stanford.nlp.util.CoreMap)2 PrintWriter (java.io.PrintWriter)2 IndexedWord (edu.stanford.nlp.ling.IndexedWord)1 SemanticGraph (edu.stanford.nlp.semgraph.SemanticGraph)1 Properties (java.util.Properties)1