0 purchases
google ml nlp
Google ML Kit Natural Language Processing (NLP) Plugin #
(https://pub.dev/packages/google_ml_nlp)
A Flutter plugin to use the capabilities of on-device Google ML Kit Natural Language Processing APIs
Usage #
To use this plugin, add google_ml_nlp as a dependency in your pubspec.yaml file.
Using an Entity Extractor #
1. Import google_ml_nlp. #
import 'package:google_ml_nlp/google_ml_nlp.dart';
copied to clipboard
2. Create and initialize your EntityExtractor. #
EntityExtractor entityExtractor = GoogleNLP.instance.entityExtractor();
await entityExtractor.init();
copied to clipboard
3. Annotate text #
List<EntityAnnotation> res = await entityExtractor.annotate(submitText);
for (EntityAnnotation eA in res) {
print(eA.annotatedText);
for (Entity e in eA.entities) {
print(e.type.toString());
if (e.type == EntityType.tracking_number) {
print(e.parcelCarrier);
print(e.parcelTrackingNumber);
}
}
}
copied to clipboard
Getting Started #
See the example directory for a complete sample app using Google ML Kit NLP.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.