Skip to content

Commit 960f677

Browse files
committed
release 4.7.2
1 parent d273b69 commit 960f677

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5012
-2409
lines changed

accuracy/models-accuracy.ipynb

Lines changed: 85 additions & 553 deletions
Large diffs are not rendered by default.

docs/generate

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22

33
cp ../README.rst .
4+
cp ../accuracy/models-accuracy.ipynb .
45
rm -rf _build/html && make html
56
find . -name "*Magic*" -exec rm -rf {} \;

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Contents:
2020
Dataset
2121
Installation
2222
load-cache
23+
models-accuracy
2324
running-on-windows
2425
Api
2526
Contributing

docs/load-dependency.ipynb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"name": "stdout",
3939
"output_type": "stream",
4040
"text": [
41-
"CPU times: user 5.15 s, sys: 925 ms, total: 6.07 s\n",
42-
"Wall time: 6.8 s\n"
41+
"CPU times: user 6.15 s, sys: 1.31 s, total: 7.46 s\n",
42+
"Wall time: 9.21 s\n"
4343
]
4444
}
4545
],
@@ -48,6 +48,15 @@
4848
"import malaya"
4949
]
5050
},
51+
{
52+
"cell_type": "markdown",
53+
"metadata": {},
54+
"source": [
55+
"### Models accuracy\n",
56+
"\n",
57+
"We use `sklearn.metrics.classification_report` for accuracy reporting, check at https://malaya.readthedocs.io/en/latest/models-accuracy.html#dependency-parsing"
58+
]
59+
},
5160
{
5261
"cell_type": "markdown",
5362
"metadata": {},

docs/load-emotion.ipynb

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"name": "stdout",
3939
"output_type": "stream",
4040
"text": [
41-
"CPU times: user 6 s, sys: 1.23 s, total: 7.23 s\n",
42-
"Wall time: 8.33 s\n"
41+
"CPU times: user 6.19 s, sys: 1.27 s, total: 7.46 s\n",
42+
"Wall time: 9.01 s\n"
4343
]
4444
}
4545
],
@@ -48,6 +48,53 @@
4848
"import malaya"
4949
]
5050
},
51+
{
52+
"cell_type": "markdown",
53+
"metadata": {},
54+
"source": [
55+
"### Models accuracy\n",
56+
"\n",
57+
"We use `sklearn.metrics.classification_report` for accuracy reporting, check at https://malaya.readthedocs.io/en/latest/models-accuracy.html#emotion-analysis"
58+
]
59+
},
60+
{
61+
"cell_type": "markdown",
62+
"metadata": {},
63+
"source": [
64+
"### labels supported\n",
65+
"\n",
66+
"Default labels for emotion module."
67+
]
68+
},
69+
{
70+
"cell_type": "code",
71+
"execution_count": 2,
72+
"metadata": {},
73+
"outputs": [
74+
{
75+
"data": {
76+
"text/plain": [
77+
"['anger', 'fear', 'happy', 'love', 'sadness', 'surprise']"
78+
]
79+
},
80+
"execution_count": 2,
81+
"metadata": {},
82+
"output_type": "execute_result"
83+
}
84+
],
85+
"source": [
86+
"malaya.emotion.label"
87+
]
88+
},
89+
{
90+
"cell_type": "markdown",
91+
"metadata": {},
92+
"source": [
93+
"### Example texts\n",
94+
"\n",
95+
"Copy pasted from random tweets."
96+
]
97+
},
5198
{
5299
"cell_type": "code",
53100
"execution_count": 2,
@@ -413,15 +460,6 @@
413460
"malaya.emotion.available_transformer()"
414461
]
415462
},
416-
{
417-
"cell_type": "markdown",
418-
"metadata": {},
419-
"source": [
420-
"Make sure you can check accuracy chart from here first before select a model, https://malaya.readthedocs.io/en/latest/Accuracy.html#emotion-analysis\n",
421-
"\n",
422-
"**You might want to use Tiny-Albert, a very small size, 22.4MB, but the accuracy is still on the top notch.**"
423-
]
424-
},
425463
{
426464
"cell_type": "markdown",
427465
"metadata": {},
@@ -726,7 +764,11 @@
726764
"\n",
727765
"```python\n",
728766
"def predict_words(\n",
729-
" self, string: str, method: str = 'last', visualization: bool = True\n",
767+
" self,\n",
768+
" string: str,\n",
769+
" method: str = 'last',\n",
770+
" bins_size: float = 0.05,\n",
771+
" visualization: bool = True,\n",
730772
"):\n",
731773
" \"\"\"\n",
732774
" classify words.\n",
@@ -740,12 +782,14 @@
740782
" * ``'last'`` - attention from last layer.\n",
741783
" * ``'first'`` - attention from first layer.\n",
742784
" * ``'mean'`` - average attentions from all layers.\n",
785+
" bins_size: float, optional (default=0.05)\n",
786+
" default bins size for word distribution histogram.\n",
743787
" visualization: bool, optional (default=True)\n",
744788
" If True, it will open the visualization dashboard.\n",
745789
"\n",
746790
" Returns\n",
747791
" -------\n",
748-
" result: dict\n",
792+
" dictionary: results\n",
749793
" \"\"\"\n",
750794
"```\n",
751795
"\n",

docs/load-entities.ipynb

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@
4848
"import malaya"
4949
]
5050
},
51+
{
52+
"cell_type": "markdown",
53+
"metadata": {},
54+
"source": [
55+
"### Models accuracy\n",
56+
"\n",
57+
"We use `sklearn.metrics.classification_report` for accuracy reporting, check at https://malaya.readthedocs.io/en/latest/models-accuracy.html#entities-recognition and https://malaya.readthedocs.io/en/latest/models-accuracy.html#entities-recognition-ontonotes5"
58+
]
59+
},
5160
{
5261
"cell_type": "markdown",
5362
"metadata": {},
@@ -487,13 +496,6 @@
487496
"malaya.entity.available_transformer()"
488497
]
489498
},
490-
{
491-
"cell_type": "markdown",
492-
"metadata": {},
493-
"source": [
494-
"Make sure you can check accuracy chart from here first before select a model, https://malaya.readthedocs.io/en/latest/models-accuracy.html#Entities-Recognition"
495-
]
496-
},
497499
{
498500
"cell_type": "markdown",
499501
"metadata": {},
@@ -643,13 +645,6 @@
643645
"malaya.entity.available_transformer_ontonotes5()"
644646
]
645647
},
646-
{
647-
"cell_type": "markdown",
648-
"metadata": {},
649-
"source": [
650-
"Make sure you can check accuracy chart from here first before select a model, https://malaya.readthedocs.io/en/latest/models-accuracy.html#Entities-Recognition-Ontonotes5"
651-
]
652-
},
653648
{
654649
"cell_type": "code",
655650
"execution_count": 36,

docs/load-language-detection.ipynb

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,12 @@
3434
"execution_count": 1,
3535
"metadata": {},
3636
"outputs": [
37-
{
38-
"name": "stderr",
39-
"output_type": "stream",
40-
"text": [
41-
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow_addons/utils/ensure_tf_install.py:68: UserWarning: Tensorflow Addons supports using Python ops for all Tensorflow versions above or equal to 2.2.0 and strictly below 2.4.0 (nightly versions are not supported). \n",
42-
" The versions of TensorFlow you are currently using is 2.4.1 and is not supported. \n",
43-
"Some things might work, some things might not.\n",
44-
"If you were to encounter a bug, do not file an issue.\n",
45-
"If you want to make sure you're using a tested and supported configuration, either change the TensorFlow version or the TensorFlow Addons's version. \n",
46-
"You can find the compatibility matrix in TensorFlow Addon's readme:\n",
47-
"https://github.com/tensorflow/addons\n",
48-
" UserWarning,\n"
49-
]
50-
},
5137
{
5238
"name": "stdout",
5339
"output_type": "stream",
5440
"text": [
55-
"CPU times: user 5.17 s, sys: 990 ms, total: 6.16 s\n",
56-
"Wall time: 6.67 s\n"
41+
"CPU times: user 5.72 s, sys: 1.14 s, total: 6.87 s\n",
42+
"Wall time: 8.29 s\n"
5743
]
5844
}
5945
],
@@ -67,7 +53,18 @@
6753
"cell_type": "markdown",
6854
"metadata": {},
6955
"source": [
70-
"### List available language detected"
56+
"### Models accuracy\n",
57+
"\n",
58+
"We use `sklearn.metrics.classification_report` for accuracy reporting, check at https://malaya.readthedocs.io/en/latest/models-accuracy.html#language-detection"
59+
]
60+
},
61+
{
62+
"cell_type": "markdown",
63+
"metadata": {},
64+
"source": [
65+
"### labels supported\n",
66+
"\n",
67+
"Default labels for language detection module."
7168
]
7269
},
7370
{
@@ -572,8 +569,6 @@
572569
"source": [
573570
"### Load Deep learning model\n",
574571
"\n",
575-
"Deep learning model is slightly more accurate then fast-text model, can check accuracy comparison at here, https://malaya.readthedocs.io/en/latest/Accuracy.html#language-detection\n",
576-
"\n",
577572
"```python\n",
578573
"def deep_model(quantized: bool = False, **kwargs):\n",
579574
" \"\"\"\n",

docs/load-pos.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"name": "stdout",
3939
"output_type": "stream",
4040
"text": [
41-
"CPU times: user 4.09 s, sys: 556 ms, total: 4.65 s\n",
42-
"Wall time: 3.75 s\n"
41+
"CPU times: user 5.94 s, sys: 1.17 s, total: 7.11 s\n",
42+
"Wall time: 8.41 s\n"
4343
]
4444
}
4545
],
@@ -48,6 +48,15 @@
4848
"import malaya"
4949
]
5050
},
51+
{
52+
"cell_type": "markdown",
53+
"metadata": {},
54+
"source": [
55+
"### Models accuracy\n",
56+
"\n",
57+
"We use `sklearn.metrics.classification_report` for accuracy reporting, check at https://malaya.readthedocs.io/en/latest/models-accuracy.html#pos-recognition"
58+
]
59+
},
5160
{
5261
"cell_type": "markdown",
5362
"metadata": {},
@@ -320,15 +329,6 @@
320329
"malaya.pos.available_transformer()"
321330
]
322331
},
323-
{
324-
"cell_type": "markdown",
325-
"metadata": {},
326-
"source": [
327-
"Make sure you can check accuracy chart from here first before select a model, https://malaya.readthedocs.io/en/latest/Accuracy.html#pos-recognition\n",
328-
"\n",
329-
"**You might want to use Tiny-Albert, a very small size, 22.4MB, but the accuracy is still on the top notch.**"
330-
]
331-
},
332332
{
333333
"cell_type": "code",
334334
"execution_count": 4,

0 commit comments

Comments
 (0)