Thrift module: base

ModuleServicesData typesConstants
baseBaseService
AnnotationFailedException
Clustering
Forest
Labeling
Node
Relation
ServiceSecurityException
ServiceUnavailableException
Source
Span
Text
Tree
View

Type declarations

Typedef: Text

Base type: string

Typedef: Source

Base type: string


Data structures

Struct: Span

FieldTypeDescriptionRequirednessDefault value
starti32start index of span in the raw text (inclusive). required
endingi32ending index of span in the raw text (exclusive). required
labelstringlabel for span. optional
scoredoublescore of span. optional
sourceSourcesource of span. optional
attributesmap<string, string>any additional attributes assoicated with this span. optional
multiIndexi32index of the text (in the multirecord) to which this span references. optional

Span covers a portion of text.

start - start index of span in the raw text (inclusive).
ending - end index of span in the raw text (exclusive).
label - label for span.
score - score of span.
source - the source annotator of this span.
attributes - any additional attributes assoicated with this span. a map of attribute_name => value.
multiIndex - if associated with a MultiRecord which Record object is this span for.


Struct: Labeling

FieldTypeDescriptionRequirednessDefault value
labelslist<Span>the labels as spans. required
sourceSourcethe source of this labeling came from. optional
scoredoublescore for this labeling. optional
rawTextstringthe raw text for this labeling (if null then consult the labeling's parent's rawText field) optional

A labeling of text. Really a list of Spans.

labels - the labels for this labeling. Each label represented as a Span.
source - the source annotator this labeling came from.
score - the score for this labeling.
rawText - the raw text for this labeling (if null then consult the labeling's parent's rawText field, i.e., the Record's)

Struct: Clustering

FieldTypeDescriptionRequirednessDefault value
clusterslist<Labeling>the clusters, each cluster is a Labeling. required
sourceSourcethe source of this Clustering optional
scoredoublescore for this clustering optional
rawTextstringthe raw text for this clustering (if null then consult the clustering's parent's rawText field) optional

A clustering of labels for the text. Each cluster is represented as a Labeling which in turn will have labels (list) representing each item in the cluster.

clusters - the clusters for the this clustering. Each cluster represented as a Labeling.
source - the source annotator this clustering came from.
score - the score for this clustering.
rawText - the raw text for this clustering (if null then consult the labeling's parent's rawText field, i.e., the Record's)

Struct: Node

FieldTypeDescriptionRequirednessDefault value
labelstringthe label of the node. required
spanSpanthe span this node covers. optional
childrenmap<i32, string>the children of the node represented as a map of . Empty string implies no label. optional
sourceSourcesource of the node . optional
scoredoublethe score for this node. optional

Nodes store their children. Referenced as index into list in the containing struct. Here the link between Node can be labeled.

label - the label for this Node.
span - the span this node covers.
children - the children of the node represented as a map of . Empty string implies no label. The index is the index of the node in the parent data structure (i.e., the tree's nodes).
source - the source annotator this node came from.
score - the score for this node.

Struct: Tree

FieldTypeDescriptionRequirednessDefault value
nodeslist<Node>list of labeled nodes. required
topi32the index of top/root node in nodes. required
sourceSourcethe source of this tree. optional
scoredoublethe score of this tree. optional

Trees are a set of connected nodes with a top node.

nodes - the list of labeled nodes.
top - the index in nodes of the top node.
source - the source annotator this Tree came from.
score - the score for this Tree.

Struct: Forest

FieldTypeDescriptionRequirednessDefault value
treeslist<Tree>the trees in this Forest required
rawTextstringthe raw text for this Forest (if null then consult the tree's parent's rawText field) optional
sourceSourcethe source of this Forest optional

Forest is a set of trees.

trees - the trees for the this forest.
source - the source annotator this forest came from.
score - the score for this forest.
rawText - the raw text for this forest (if null then consult the labeling's parent's rawText field, i.e., the Record's)

Struct: Relation

FieldTypeDescriptionRequirednessDefault value
starti32required
endingi32required
labelstringoptional
sourceSourceoptional
scoredoubleoptional

Relations are between two spans.

start - the index of the span that starts this relation.
ending - the index of the span that ends this relation.
label - the label for this relation.
source - where this relation came from.
score - the score for this relation.

Struct: View

FieldTypeDescriptionRequirednessDefault value
spanslist<Span>required
relationslist<Relation>required
rawTextstringoptional
sourceSourceoptional
scoredoubleoptional

A View is the most general data structure. Spans and their relations.

spans - the spans of for this view.
relations - the relations of this view.
source - the source annotator this view came from.
score - the score for this view.
rawText - the raw text for this view (if null then consult the labeling's parent's rawText field, i.e., the Record's)

Exception: ServiceUnavailableException

FieldTypeDescriptionRequirednessDefault value
reasonstringdefault

Exception: ServiceSecurityException

FieldTypeDescriptionRequirednessDefault value
reasonstringdefault

Exception: AnnotationFailedException

FieldTypeDescriptionRequirednessDefault value
reasonstringdefault


Services

Service: BaseService

Base Service

Function: BaseService.ping

bool ping()
Ping? Pong! return True!

Function: BaseService.getName

string getName()
Return the name of this service.

Function: BaseService.getVersion

string getVersion()
Return the version of this service.

Function: BaseService.getSourceIdentifier

string getSourceIdentifier()
Return the an identifier to be used in source fields. This should be of the form - where contains no spaces or hypens and is parsable into a number (double, int etc). i.e.,. server-1.0.

Any datastructures returned must have the source field populated with the result of this function.