@mediapipe/tasks-text 0.1.0-alpha-2 → 0.1.0-alpha-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # MediaPipe Tasks Text Package
2
+
3
+ This package contains the text tasks for MediaPipe.
4
+
5
+ ## Text Classification
6
+
7
+ MediaPipe Text Classifier task lets you classify text into a set of defined
8
+ categories, such as positive or negative sentiment.
9
+
10
+ ```
11
+ const text = await FilesetResolver.forTextTasks(
12
+ "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-text@latest/wasm"
13
+ );
14
+ const textClassifier = await TextClassifier.createFromModelPath(text,
15
+ "https://storage.googleapis.com/mediapipe-tasks/text_classifier/bert_text_classifier.tflite"
16
+ );
17
+ const classifications = textClassifier.classifiy(textData);
18
+ ```
19
+
20
+ For more information, refer to the [Text Classification](https://developers.google.com/mediapipe/solutions/text/text_classifier/web_js) documentation.
21
+
22
+ ## Text Embedding
23
+
24
+ The MediaPipe Text Embedding task extracts embeddings from text data.
25
+
26
+ ```
27
+ const text = await FilesetResolver.forTextTasks(
28
+ "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-text@latest/wasm"
29
+ );
30
+ const textEmbedder = await TextEmbedder.createFromModelPath(text,
31
+ "https://storage.googleapis.com/mediapipe-tasks/text_embedder/mobilebert_embedding_with_metadata.tflite"
32
+ );
33
+ const embeddings = textEmbedder.embed(textData);
34
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediapipe/tasks-text",
3
- "version": "0.1.0-alpha-2",
3
+ "version": "0.1.0-alpha-3",
4
4
  "description": "MediaPipe Text Tasks",
5
5
  "main": "text_bundle.js",
6
6
  "author": "mediapipe@google.com",