Do I have to put from_entity inorder for duckling to extract while we are doing formaction in rasa 2.0?

Do I have to put from_entity inorder for duckling to extract while we are doing formaction in rasa 2.0?

Hey @faiza_conte

Could you please clarify what you’re trying to archive?

While am doing a formaction in rasa 2.0 …in the domain file making the form from_entity and from_text these two things,does they influence the way the duckling works if am trying to extract entities using duckling ??

Yes, if you want to fill a slot from a duckling entity, you should put:

forms:
  form_name:
    slot_to_fill:
      - type: from_entity
        entity: duckling_entity

Duckling will extract things regardless of your slot mappings; it looks only at the text of the user message. But your slot will only be filled from the duckling entity if the mapping is correct.

Okay thanks…but if I want to extract name from a text then which entity extraction for person name is preferable???..if duckling can extract such as time ,duration ,number and so on from a user utterance then if I want to extract a person name form user text or utterance which way is better ??

Duckling does not extract names. It extracts regularly patterned entities (like dates, numbers, etc.). For proper names, try SpaCy.

I’m not sure what you mean by “f I want to extract a person name form user text or utterance which way is better ??” User text and utterance are the same thing (at least that’s how I think about it)

Ya user text/utterance the same…for duckling we font have to put possible entities in nlu …but for spacy I dont think it works like duckling tho

Spacy also does not require you to annotate entities it extracts. It uses different models than duckling, but it’s still pretrained.

then if am using spacy what would happen to other entities like custom entites…how are they trained?..

Custom entities are still trained as usual. You should not give entities names that conflict with SpaCy or Duckling dimensions (e.g. PERSON is the SpaCy name dimension, so don’t call a custom entity `PERSON). You can include as many custom entities as you’d like in your training data, this has no impact on the behaviour of either Spacy or Duckling

Okay…so the tokenizers if I use spacy it still tokenizes any utterances and the custom entities will be trained with dietclassifer and other rasa models…did I get that??

Yes, if you use spacy tokenizer, it will still tokenize things as usual. if you use SpacyEntityExtractor, it will extract spacy entities. If you include dietclassifier, it will extract custom entities, and it will not interfere with Spacy.

@mloubser…j have another issue and…assume I have diet classifier and regexentityextracter and I have a phone_no entity to be extracted and I also have a regex for it…so both diet classifier and regexentityextracter extracted phone_no…that means an entity is extracted twice and stored to bot memory as a list. Then when j try to get the value with tracker.get_slot to store it to database it throws error saing that python list can not be converted to mysql…so how can I grab one value from extracted slot and store it to database??

what does the domain entry for that slot look like?

Phone_no…any and unfeuterized …am doing a formfilling …where phone_no is from_entity

@mloubser…it become a list how can i access it

instead of putting type any, try type text and keep unfeaturized=true

okay i will try that