Artificial intelligence to detect and forecast earthquakes