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)
==============