Interface TextAnnotation
- All Superinterfaces:
org.opencastproject.mediapackage.XmlElement
- All Known Implementing Classes:
TextAnnotationImpl
public interface TextAnnotation
extends org.opencastproject.mediapackage.XmlElement
Base interface for text annotations with relevance and confidence values.
<complexType name="TextAnnotationType">
<choice minOccurs="1" maxOccurs="unbounded">
<element name="FreeTextAnnotation" type="mpeg7:TextualType"/>
<element name="StructuredAnnotation" type="mpeg7:StructuredAnnotationType"/>
<element name="DependencyStructure" type="mpeg7:DependencyStructureType"/>
<element name="KeywordAnnotation" type="mpeg7:KeywordAnnotationType"/>
</choice>
<attribute name="relevance" type="mpeg7:zeroToOneType" use="optional"/>
<attribute name="confidence" type="mpeg7:zeroToOneType" use="optional"/>
<attribute ref="xml:lang"/>
</complexType>
TODO: How to encode source and version? Maybe use MediaInformation in VideoSegment-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFreeTextAnnotation(FreeTextAnnotation freeTextAnnotation) Adds a free text annotation.voidaddKeywordAnnotation(KeywordAnnotation keywordAnnotation) Adds a new keyword annotation.Returns an iteration of the free text annotations.floatReturns the confidence of the validity of this annotation.Returns the language of this annotation in ISO represenatation, e. g.floatReturns the relevance of this annotation.Returns an iteration of the keyword annotations.Methods inherited from interface org.opencastproject.mediapackage.XmlElement
toXml
-
Method Details
-
getRelevance
float getRelevance()Returns the relevance of this annotation.- Returns:
- the relevance value
-
getConfidence
float getConfidence()Returns the confidence of the validity of this annotation. The value will be in the range of0.0and1.0. The confidence may vary with the technique that was used to create the annotation. For example, extracting a word using optical character recognition usually has a better confidence value than speech recognition.- Returns:
- the confidence value
-
getLanguage
String getLanguage()Returns the language of this annotation in ISO represenatation, e. g.enfor annotations in English.- Returns:
- the language
-
addKeywordAnnotation
Adds a new keyword annotation.- Parameters:
keywordAnnotation- the annotation
-
addFreeTextAnnotation
Adds a free text annotation.- Parameters:
freeTextAnnotation- the annotation
-
keywordAnnotations
Iterator<KeywordAnnotation> keywordAnnotations()Returns an iteration of the keyword annotations.- Returns:
- the keyword annotations
-
freeTextAnnotations
Iterator<FreeTextAnnotation> freeTextAnnotations()Returns an iteration of the free text annotations.- Returns:
- the free text annotations
-