NCNLPEntityParser

class NCNLPEntityParser(predicate: NCToken => Boolean) extends NCEntityParser

Common NLP data entity parser.

This parser converts list of input NCToken instances one-to-one to the list of NCEntity instances with type nlp:entity. All NCEntity instances in the result list will contain the following metadata properties:

  • nlp:entity:text - token's text.
  • nlp:entity:index - token's index in the input sentence.
  • nlp:entity:startCharIndex - token text's first character index in the input sentence.
  • nlp:entity:endCharIndex - token text 's last character index in the input sentence.

Note that NCEntity instances inherit all NCToken metadata properties from its corresponding token with new name that is prefixed with 'nlp:entity:'. For example, for token property prop the corresponding inherited entity property name will be nlp:entity:prop.

Value parameters:
predicate

Predicate which allows to filter list of converted NCToken instances. Only tokens that satisfy given predicate will convert to entity by this parser. By default all NCToken instances are converted.

Source:
NCNLPEntityParser.scala
class Object
trait Matchable
class Any

Value members

Concrete methods

override def parse(req: NCRequest, cfg: NCModelConfig, toks: List[NCToken]): List[NCEntity]

Parses and converts given list of tokens into the list of entities.

Parses and converts given list of tokens into the list of entities.

Definition Classes
Source:
NCNLPEntityParser.scala

Inherited methods

Called when the component starts. Default implementation is no-op.

Called when the component starts. Default implementation is no-op.

Value parameters:
cfg

Configuration of the model this component is associated with.

Inherited from:
NCLifecycle
Source:
NCLifecycle.scala

Called when the component stops. Default implementation is no-op.

Called when the component stops. Default implementation is no-op.

Value parameters:
cfg

Configuration of the model this component is associated with.

Inherited from:
NCLifecycle
Source:
NCLifecycle.scala