concrete.clustering.ttypes module¶
-
class
concrete.clustering.ttypes.
Cluster
(clusterMemberIndexList=None, confidenceList=None, childIndexList=None)¶ Bases:
object
A set of items which are alike in some way. Has an implicit id which is the index of this Cluster in its parent Clustering’s ‘clusterList’.
-
- clusterMemberIndexList
The items in this cluster. Values are indices into the
- ‘clusterMemberList’ of the Clustering which contains this Cluster.
- confidenceList: Co-indexed with ‘clusterMemberIndexList’. The i^{th} value represents the
- confidence that mention clusterMemberIndexList[i] belongs to this cluster.
- childIndexList: A set of clusters (implicit ids/indices) from which this cluster was
created. This cluster should represent the union of all the items in all of the child clusters. (For hierarchical clustering only).
-
read
(iprot)¶
-
thrift_spec
= (None, (1, 15, 'clusterMemberIndexList', (8, None, False), None), (2, 15, 'confidenceList', (4, None, False), None), (3, 15, 'childIndexList', (8, None, False), None))¶
-
validate
()¶
-
write
(oprot)¶
-
-
class
concrete.clustering.ttypes.
ClusterMember
(communicationId=None, setId=None, elementId=None)¶ Bases:
object
An item being clustered. Does not designate cluster _membership_, as in “item x belongs to cluster C”, but rather just the item (“x” in this example). Membership is indicated through Cluster objects. An item may be a Entity, EntityMention, Situation, SituationMention, or technically anything with a UUID.
-
- communicationId
UUID of the Communication which contains the item specified by ‘elementId’.
- This is ancillary info assuming UUIDs are indeed universally unique.
- setId: UUID of the Entity|Situation(Mention)Set which contains the item specified by ‘elementId’.
- This is ancillary info assuming UUIDs are indeed universally unique.
- elementId: UUID of the EntityMention, Entity, SituationMention, or Situation that
this item represents. This is the characteristic field.
-
read
(iprot)¶
-
thrift_spec
= (None, (1, 12, 'communicationId', (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), None), (2, 12, 'setId', (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), None), (3, 12, 'elementId', (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), None))¶
-
validate
()¶
-
write
(oprot)¶
-
-
class
concrete.clustering.ttypes.
Clustering
(uuid=None, metadata=None, clusterMemberList=None, clusterList=None, rootClusterIndexList=None)¶ Bases:
object
An (optionally) hierarchical clustering of items appearing across a set of Communications (intra-Communication clusterings are encoded by Entities and Situations). An item may be a Entity, EntityMention, Situation, SituationMention, or technically anything with a UUID.
- Attributes:
- uuid: UUID for this Clustering object.
- metadata: Metadata for this Clustering object.
- clusterMemberList: The set of items being clustered.
- clusterList: Clusters of items. If this is a hierarchical clustering, this may contain
clusters which are the set of smaller clusters. Clusters may not “overlap”, meaning (for all clusters X,Y):
X cap Yeq emptyset implies X subset Y ee Y subset X
- rootClusterIndexList: A set of disjoint clusters (indices in ‘clusterList’) which cover all
items in ‘clusterMemberList’. This list must be specified for hierarchical clusterings and should not be specified for flat clusterings.
-
read
(iprot)¶
-
thrift_spec
= (None, (1, 12, 'uuid', (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), None), (2, 12, 'metadata', (<class 'concrete.metadata.ttypes.AnnotationMetadata'>, (None, (1, 11, 'tool', 'UTF8', None), (2, 10, 'timestamp', None, None), None, (4, 12, 'digest', (<class 'concrete.metadata.ttypes.Digest'>, (None, (1, 11, 'bytesValue', 'BINARY', None), (2, 10, 'int64Value', None, None), (3, 4, 'doubleValue', None, None), (4, 11, 'stringValue', 'UTF8', None), (5, 15, 'int64List', (10, None, False), None), (6, 15, 'doubleList', (4, None, False), None), (7, 15, 'stringList', (11, 'UTF8', False), None))), None), (5, 12, 'dependencies', (<class 'concrete.metadata.ttypes.TheoryDependencies'>, (None, (1, 15, 'sectionTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (2, 15, 'sentenceTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (3, 15, 'tokenizationTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (4, 15, 'posTagTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (5, 15, 'nerTagTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (6, 15, 'lemmaTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (7, 15, 'langIdTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (8, 15, 'parseTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (9, 15, 'dependencyParseTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (10, 15, 'tokenAnnotationTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (11, 15, 'entityMentionSetTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (12, 15, 'entitySetTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (13, 15, 'situationMentionSetTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (14, 15, 'situationSetTheoryList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None), (15, 15, 'communicationsList', (12, (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), False), None))), None), (6, 8, 'kBest', None, 1))), None), (3, 15, 'clusterMemberList', (12, (<class 'concrete.clustering.ttypes.ClusterMember'>, (None, (1, 12, 'communicationId', (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), None), (2, 12, 'setId', (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), None), (3, 12, 'elementId', (<class 'concrete.uuid.ttypes.UUID'>, (None, (1, 11, 'uuidString', 'UTF8', None))), None))), False), None), (4, 15, 'clusterList', (12, (<class 'concrete.clustering.ttypes.Cluster'>, (None, (1, 15, 'clusterMemberIndexList', (8, None, False), None), (2, 15, 'confidenceList', (4, None, False), None), (3, 15, 'childIndexList', (8, None, False), None))), False), None), (5, 15, 'rootClusterIndexList', (8, None, False), None))¶
-
validate
()¶
-
write
(oprot)¶