Map<String, dynamic> toJson() { return { 'text': text, 'recognitions': recognitions?.map((e) => e.toJson()).toList(), }..removeWhere((key, value) => value == null); }