Nasty.AST.Semantic.CorefChain (Nasty v0.3.0)
View SourceCoreference chain linking mentions that refer to the same entity.
A chain contains all mentions of an entity throughout a document, along with a representative mention (typically the first proper name or most informative noun phrase).
Summary
Functions
Finds mention at a specific sentence index.
Returns the first mention in the chain.
Returns the last mention in the chain.
Counts mentions in the chain.
Creates a new coreference chain.
Selects the best representative mention from a list.
Types
@type t() :: %Nasty.AST.Semantic.CorefChain{ entity_type: atom() | nil, id: pos_integer(), mentions: [Nasty.AST.Semantic.Mention.t()], representative: String.t() }
Functions
@spec find_mention_at(t(), non_neg_integer()) :: [Nasty.AST.Semantic.Mention.t()]
Finds mention at a specific sentence index.
@spec first_mention(t()) :: Nasty.AST.Semantic.Mention.t() | nil
Returns the first mention in the chain.
@spec last_mention(t()) :: Nasty.AST.Semantic.Mention.t() | nil
Returns the last mention in the chain.
@spec mention_count(t()) :: non_neg_integer()
Counts mentions in the chain.
@spec new(pos_integer(), [Nasty.AST.Semantic.Mention.t()], String.t(), keyword()) :: t()
Creates a new coreference chain.
@spec select_representative([Nasty.AST.Semantic.Mention.t()]) :: String.t()
Selects the best representative mention from a list.
Preference order:
- First proper name
- Longest definite NP
- First mention