def train_parsers(self, skills): """Train the parsers.""" if "parsers" in self.config: parsers = self.config["parsers"] or [] tasks = [] rasanlu = [p for p in parsers if p["name"] == "rasanlu"] if len(rasanlu) == 1 and ("enabled" not in rasanlu[0] or rasanlu[0]["enabled"] is not False): tasks.append( asyncio.ensure_future(train_rasanlu(rasanlu[0], skills), loop=self.eventloop)) self.eventloop.run_until_complete( asyncio.gather(*tasks, loop=self.eventloop))
def train_parsers(self, skills): """Train the parsers.""" if "parsers" in self.config: parsers = self.config["parsers"] or [] tasks = [] rasanlu = [p for p in parsers if p["name"] == "rasanlu"] if len(rasanlu) == 1 and \ ("enabled" not in rasanlu[0] or rasanlu[0]["enabled"] is not False): tasks.append( asyncio.ensure_future( train_rasanlu(rasanlu[0], skills), loop=self.eventloop)) self.eventloop.run_until_complete( asyncio.gather(*tasks, loop=self.eventloop))