Extracting two slots from a single phrase

So, I have a CSV dataset with various information, including a column ‘year’ and a column ‘semester’ The user can ask: Give me a list of all the subjects from third year and first semester. Synonims are not working(for 3: third, 3rd), so i tried like this : intent: ask_year_semester with examples like : - list of subjects from [third]{“entity”: “year”, “value”: “3”} year and [first]{“entity”: “semester”, “value”: “1”} semester This worked for the third year and first semester, but when for example when the user asks for semester 2 instead of 1, it returns also the year 3 and semester 1, i think that there are some conflicts. How can i resolve this issue ? My custom actions looks fine, but it doesn’t work: class actionFindSubjetSpecificYearSpecificSemester(Action): def name(self) → Text: return “action_ask_ListSubjectSpecificYearSpecificSemester” def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any] ) → List[Dict[Text, Any]]: year = tracker.get_slot(‘year’) semester = tracker.get_slot(‘semester’) with open(‘data/info.csv’,‘r’,encoding = “utf-8”) as file: reader = csv.DictReader(file) # get a list of subjects in the desired year and semester output = [row for row in reader if ((row[‘year’].lower() == year.lower()) and (row[‘semester’].lower() == semester.lower()))] if output: #reply = List of subject for specific year, semester reply = “This is a list of subjects that you will learn there” + output[0][‘year’] + “:” reply += "\n- " + "\n- “.join([item[‘subject’] for item in output]) dispatcher.utter_message(reply) else: dispatcher.utter_message(f"I could not find the subjects that you will learn the year of study: {year}”)

Your post is really hard to read. Can you reformat and use markdown?