Entity values don't show up in responses for Arabic

Hello there, Currently using Rasa 1.10.24. I have this bilingual bot that can speak English and Arabic. I have this custom action that prompts answer according to type of entity, that looks like this:

class EntityAction(Action):
	def name(self) -> Text:
		return "action_entity"

def run(self,
		dispatcher: CollectingDispatcher,
		tracker: Tracker,
		domain: Dict[Text, Any]):

	entity_value = tracker.get_latest_entity_values()
	intent_value = tracker.get_intent_of_latest_message(skip_fallback_intent=True)
	entity_type = tracker.latest_message['entities'][0]['entity']

if intent_value == "beverage" and entity_type == "juice":
			dispatcher.utter_template("utter_beverage_juice", tracker)

	elif intent_value == "beverage" and entity_type == "tea":
		dispatcher.utter_template("utter_beverage_tea", tracker)

(I have different utterance templates for both)

My responses look like this: utter_user_asking_beverage_juice: - text: سأقوم ببعض الأبحاث حتى أتمكن من مشاركة المزيد حول {juice} قريبًا.

The same goes for English. My problem is this, when this is called for English, {juice} is replaced with entity value (e.g. orange juice) but this doesn’t apply for Arabic, dispatcher utters above sentence, (literally) “سأقوم ببعض الأبحاث حتى أتمكن من مشاركة المزيد حول {juice} قريبًا.” I debugged the custom action and the agent is able to catch the entity and entity value, it just doesn’t plug it in. My suspection is Arabic being right to left and causing a problem. Any help is appreciated.

1 Like

I fear that this is indeed RTL vs LTR.

One thing that might help (and this is me thinking out loud). Could you split the NLU files into an English one and an Arabic one?

If you have a minimum viable reproducible error in nlu.yml format I’d love to whip up some Github issues by the way. This is something we really need to start tackling.

The NLU files are already separated. There’s only one actions package for action server though. What do you think I should do now, send you a reproduction of the error in a smaller repo with two languages?