@mediapipe/tasks-text 0.10.0 → 0.10.2-rc1

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 CHANGED
@@ -2,47 +2,51 @@
2
2
 
3
3
  This package contains the text tasks for MediaPipe.
4
4
 
5
- ## Language Detection
5
+ ## Language Detector
6
6
 
7
7
  The MediaPipe Language Detector task predicts the language of an input text.
8
8
 
9
9
  ```
10
10
  const text = await FilesetResolver.forTextTasks(
11
- "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-text@latest/wasm"
11
+ "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-text/wasm"
12
12
  );
13
13
  const languageDetector = await LanguageDetector.createFromModelPath(text,
14
- "model.tflite"
14
+ "https://storage.googleapis.com/mediapipe-models/language_detector/language_detector/float32/1/language_detector.tflite
15
15
  );
16
16
  const result = languageDetector.detect(textData);
17
17
  ```
18
18
 
19
- ## Text Classification
19
+ For more information, refer to the [Language Detector](https://developers.google.com/mediapipe/solutions/text/language_detector/web_js) documentation.
20
+
21
+ ## Text Classifier
20
22
 
21
23
  The MediaPipe Text Classifier task lets you classify text into a set of defined
22
24
  categories, such as positive or negative sentiment.
23
25
 
24
26
  ```
25
27
  const text = await FilesetResolver.forTextTasks(
26
- "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-text@latest/wasm"
28
+ "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-text/wasm"
27
29
  );
28
30
  const textClassifier = await TextClassifier.createFromModelPath(text,
29
- "https://storage.googleapis.com/mediapipe-tasks/text_classifier/bert_text_classifier.tflite"
31
+ "https://storage.googleapis.com/mediapipe-models/text_classifier/bert_classifier/float32/1/bert_classifier.tflite"
30
32
  );
31
33
  const classifications = textClassifier.classify(textData);
32
34
  ```
33
35
 
34
36
  For more information, refer to the [Text Classification](https://developers.google.com/mediapipe/solutions/text/text_classifier/web_js) documentation.
35
37
 
36
- ## Text Embedding
38
+ ## Text Embedder
37
39
 
38
- The MediaPipe Text Embedding task extracts embeddings from text data.
40
+ The MediaPipe Text Embedder task extracts embeddings from text data.
39
41
 
40
42
  ```
41
43
  const text = await FilesetResolver.forTextTasks(
42
- "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-text@latest/wasm"
44
+ "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-text/wasm"
43
45
  );
44
46
  const textEmbedder = await TextEmbedder.createFromModelPath(text,
45
- "https://storage.googleapis.com/mediapipe-tasks/text_embedder/mobilebert_embedding_with_metadata.tflite"
47
+ "https://storage.googleapis.com/mediapipe-models/text_embedder/universal_sentence_encoder/float32/1/universal_sentence_encoder.tflite"
46
48
  );
47
49
  const embeddings = textEmbedder.embed(textData);
48
50
  ```
51
+
52
+ For more information, refer to the [Text Embedder](https://developers.google.com/mediapipe/solutions/text/text_embedder/web_js) documentation.
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@mediapipe/tasks-text",
3
- "version": "0.10.0",
3
+ "version": "0.10.2-rc1",
4
4
  "description": "MediaPipe Text Tasks",
5
- "main": "text_bundle.js",
5
+ "main": "text_bundle.cjs",
6
+ "browser": "text_bundle.mjs",
7
+ "module": "text_bundle.mjs",
6
8
  "author": "mediapipe@google.com",
7
9
  "license": "Apache-2.0",
10
+ "type": "module",
8
11
  "types": "text.d.ts",
9
12
  "homepage": "http://mediapipe.dev",
10
13
  "keywords": [ "AR", "ML", "Augmented", "MediaPipe", "MediaPipe Tasks" ]