Number type entity extraction

I have a scenario where I need to extract number type entity. I have trained the bot with sample values but unable to retrieve entity during testing.

Do i have to train the bot with all the values?

Intent :

intent:transfer

  • transfer money 10
  • transfer money 100
  • transfer money 1000

Config :

pipeline:

  • name: “nlp_spacy”
  • name: “SpacyNLP”
  • name: “tokenizer_spacy”
  • name: “intent_featurizer_spacy”
  • name: “ner_crf”
  • name: “ner_synonyms”
  • name: “intent_classifier_sklearn”
  • name: “ner_duckling_http”

Response 1:

{ “intent”: { “name”: “transfer”, “confidence”: 0.708813915773042 }, “entities”: [ { “start”: 14, “end”: 18, “value”: “1001”, “entity”: “amount”, “confidence”: 0.6215849101261547, “extractor”: “CRFEntityExtractor” } ], “intent_ranking”: [ { “name”: “transfer”, “confidence”: 0.708813915773042 } ], “text”: “tranfer money 1001” }

Response 2:

{ “intent”: { “name”: “transfer”, “confidence”: 0.799084971250018 }, “entities”: [], “intent_ranking”: [ { “name”: “transfer”, “confidence”: 0.799084971250018 } ], “text”: “transfer money 9999” }

1 Like

Numbers should definitely be handled by duckling instead of the CRF, it’ll do a lot better of a job with it. Looks like duckling isn’t picking anything up, probably because you haven’t passed a URL to it. Are you getting any errors from duckling when you’re running the bot?

1 Like

this is a good blog to show how to install and use duckling

1 Like
  • I notice that entity is not specified in examples. Maybe could this help? :thinking:

       intents: 
            - intent: transfer_money                        
              examples: |                             
                - transfer money [10](money_value)
                - transfer money [100](money_value)
                - transfer money [1000](money_value)
    
  • BTW, it seems to me to much to involve duckling for that apparently simple problem. Also thsi could be related with my current issue: Wrong intent and entity detected if examples contains numbers as digit sequences - #7