extractEntities method
Extracts entities from the given text and returns List<EntityAnnotation>
Implementation
Future<List<EntityAnnotation>> extractEntities(String text,
{List<int>? filters, String? localeLanguage, String? timeZone}) async {
final parameters = <String, dynamic>{
'filters': filters,
'locale': localeLanguage,
'timezone': timeZone,
};
final result = await NaturalLanguage.channel.invokeMethod(
'nlp#startEntityExtractor', <String, dynamic>{
'parameters': parameters,
'text': text,
'language': _language
});
var annotation = <EntityAnnotation>[];
for (dynamic data in result) {
annotation.add(EntityAnnotation.instance(data));
}
return annotation;
}