ner_prediction#

class besser.bot.nlp.ner.ner_prediction.NERPrediction[source]#

Bases: object

The prediction result of the NER.

intent_matched_parameters#

For each intent, the list of matched parameters

Type:

dict[Intent, list[MatchedParameter]]

ner_sentences#

After NER, the original sentence is modified by replacing the found values by the entity names. Therefore, some resulting sentences may be identical. This dict contains an entry for each different sentence and the list of intents for which, after doing NER in the original sentence, that is the resulting sentence.

Type:

dict[str, list[Intent]]

add_intent_matched_parameters(intent, intent_matches)[source]#

Add a list of matched parameters to a specific intent.

Parameters:
  • intent (Intent) – the intent to add the matched parameters

  • intent_matches (list[MatchedParameter]) – the list of mathched parameters to add to the intent

add_ner_sentence(ner_sentence, intent)[source]#

Store a NER sentence and its corresponding intent.

Parameters:
  • ner_sentence (str) – the sentence after NER

  • intent (Intent) – the intent for which, after NER, the original sentence has become ner_sentence

Returns: