Class EntityMention.Builder

Enclosing class:
EntityMention

public static class EntityMention.Builder extends Attribute.Builder<EntityMention,EntityMention.Builder>
A builder for entity mentions.
  • Constructor Details

    • Builder

      public Builder(int startOffset, int endOffset, String entityType)
      Constructs a builder with the minimal required information for an entity mention.
      Parameters:
      startOffset - the start offset in the text, in characters
      endOffset - the end offset in the text, in characters
      entityType - the type of entity (e.g. "PERSON").
    • Builder

      public Builder(EntityMention toCopy)
      Constructs a builder initialized with information from an existing entity mention.
      Parameters:
      toCopy - the mention to copy.
  • Method Details

    • entityType

      public EntityMention.Builder entityType(String entityType)
      Specifies the entity type.
      Parameters:
      entityType - the entity type
      Returns:
      this
    • confidence

      public EntityMention.Builder confidence(Double confidence)
      Specifies the confidence.
      Parameters:
      confidence - the confidence, or null to indicate that no confidence is available.
      Returns:
      this
    • linkingConfidence

      public EntityMention.Builder linkingConfidence(Double linkingConfidence)
      Specifies the linking confidence.
      Parameters:
      linkingConfidence - the confidence, or null to indicate that no confidence is available.
      Returns:
      this
    • coreferenceChainId

      public EntityMention.Builder coreferenceChainId(Integer coreferenceChainId)
      Specifies the coreference chain identifier. See EntityMention.getCoreferenceChainId().
      Parameters:
      coreferenceChainId - the chain identifier, or null for a mention that is not linked.
      Returns:
      this
    • flags

      public EntityMention.Builder flags(int flags)
      Specifies the flags.
      Parameters:
      flags - flags value
      Returns:
      this
    • source

      public EntityMention.Builder source(String source)
      Specifies the source of this mention.
      Parameters:
      source - the source
      Returns:
      this
    • subsource

      public EntityMention.Builder subsource(String subsource)
      Specifies the subsource of this mention.
      Parameters:
      subsource - the subsource
      Returns:
      this
    • normalized

      public EntityMention.Builder normalized(String normalized)
      Specifies the normalized form of this mention.
      Parameters:
      normalized - the normalized form
      Returns:
      this
    • build

      public EntityMention build()
      Builds the immutable mention.
      Returns:
      the mention
    • getThis

      protected EntityMention.Builder getThis()
      Specified by:
      getThis in class Attribute.Builder<EntityMention,EntityMention.Builder>