Custom entity with roles

hello, I want to ask about extracting a custom entity,

I already have a java program that extracts entity from text like written numbers, dates, colors, locations, …etc. I have to use these entities with their roles for example in locations I need to extract the departure and destination place. so what I need is there any way to do so without hard coding all synonyms for a location, for example the model should take the output of the location extractor and give it a rule.

  • synonym: place examples: | - x - y - z - n

  • intent: flight examples: | - I want to fly from [x]{“entity”: “place”, “role”:“departure”} to [y]{“entity”: “place”, “role”:“destination”} - I want to go to [z]{“entity”: “place”, “role”:“destination”} from [n]{“entity”: “place”, “role”:"departure

so I don’t want to hard code every location and color I just need to take it from the already built java program. how can I do so?


There’s a few things that you could do. But I’m wondering what’s the easiest.

You could host the java app in a seperate docker container and have a python custom action/form validator communicate with it via a REST-api. That could work.

What I’m mainly wondering though is why you need the specific java program. Did you have a look at Duckling?