Unsupervised entity extraction without slot, trainnigs

I am trying to use the “SpacyEntityExtractor” and extract the “LOC” entity from the user input in custom actions using the tracker object as mentioned below. I am getting “None” as the output and not able to extract the entities. Can anyone please help?

Since “LOC” is a default entity type in SpacyEntityExtractor, I did not define any slot …Is this correct approach?.. Is there any example of doing an entity extraction from unsupervised data like place, date,country…etc?

Config.yml

language: en pipeline:

  • name: nlp_spacy
  • name: SpacyTokenizer
  • name: SpacyFeaturizer
  • name: SklearnIntentClassifier
  • name: SpacyEntityExtractor dimensions:
    • PERSON
    • LOC
    • ORG
    • PRODUCT policies:
  • name: MemoizationPolicy
  • name: KerasPolicy
  • name: MappingPolicy

============= in custom actions.py,

    ent_intent = tracker.latest_message['intent'].get('name')
    ent_name= prediction['entities'][0]['entity']
    ent_array= tracker.latest_message['entities']
   print(ent_intent)
   print(ent_name)
   print(ent_array)

==============

Hi @shanub, You do need to define a slot, and you also must make sure to include entity extraction example sentences in the nlu.md.

For example, when using PERSON, you define this in your domain.yml

entities:
- PERSON
slots:
  PERSON:
    type: text

And some examples in your nlu.md, like this:

## intent:greet
- Hi, I am [John Doe](PERSON)
1 Like

thank you, it works!

1 Like