ner#

class besser.bot.nlp.ner.ner.NER(nlp_engine, bot)[source]#

Bases: ABC

The NER (Named Entity Recognition) abstract class.

The NER component is in charge of identifying entities in a text, particularly in a user message.

Parameters:
  • nlp_engine (NLPEngine) – the NLPEngine that handles the NLP processes of the bot

  • bot (Bot) – the bot the NER belongs to

_nlp_engine#

The NLPEngine that handles the NLP processes of the bot

_bot#

The bot the NER belongs to

_abc_impl = <_abc._abc_data object>#
abstract predict(state, message)[source]#

Predict the entities of a given message.

Parameters:
  • state (State) – the state where the user is in. It is necessary to know the entities that can be matched (not all entities can be matched from a specific state, only those of the state’s intents)

  • message (str) – the message to predict the entities

Returns:

the result of the NER prediction

Return type:

NERPrediction

abstract train()[source]#

Train the NER.