@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 +14 -10
- package/package.json +5 -2
- package/text_bundle.cjs +2 -0
- package/text_bundle.cjs.map +1 -0
- package/{text_bundle.js → text_bundle.mjs} +2 -1
- package/text_bundle.mjs.map +1 -0
- package/wasm/text_wasm_internal.wasm +0 -0
- package/wasm/text_wasm_nosimd_internal.wasm +0 -0
- package/wasm/text_wasm_internal.js +0 -6294
- package/wasm/text_wasm_nosimd_internal.js +0 -6294
package/README.md
CHANGED
|
@@ -2,47 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
This package contains the text tasks for MediaPipe.
|
|
4
4
|
|
|
5
|
-
## Language
|
|
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
|
|
11
|
+
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-text/wasm"
|
|
12
12
|
);
|
|
13
13
|
const languageDetector = await LanguageDetector.createFromModelPath(text,
|
|
14
|
-
"
|
|
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
|
-
|
|
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
|
|
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-
|
|
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
|
|
38
|
+
## Text Embedder
|
|
37
39
|
|
|
38
|
-
The MediaPipe Text
|
|
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
|
|
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-
|
|
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.
|
|
3
|
+
"version": "0.10.2-rc1",
|
|
4
4
|
"description": "MediaPipe Text Tasks",
|
|
5
|
-
"main": "text_bundle.
|
|
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" ]
|