You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-22Lines changed: 46 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,33 +18,57 @@ If you are interested in contributing to **vntk**, or just hacking on it, then f
18
18
19
19
Jump to guide: [How to build an NLP API Server using Vntk](#nlp-api-server).
20
20
21
+
# Documentation
22
+
23
+
*[**CLI Utilities**](#cli-utilities)
24
+
*[1. Installation](#1-installation)
25
+
*[2. Usage Example](#2-usage-example)
26
+
*[**API Usage**](#api-usage)
27
+
*[1. Tokenizer](#1-tokenizer)
28
+
*[2. Word Segmentation](#2-word-segmentation)
29
+
*[3. POS Tagging](#3-pos-tagging)
30
+
*[4. Chunking](#4-chunking)
31
+
*[5. Named Entity Recognition](#5-named-entity-recognition)
32
+
*[PER LOC ORG](#ner-per-loc-org)
33
+
*[Date time](#ner-date-time)
34
+
*[Custom NER](#ner-custom)
35
+
*[6. Utility](#6-utility)
36
+
*[Dictionary](#dictionary)
37
+
*[Clean html](#clean-html)
38
+
*[7. TF-IDF](#7-tf-idf)
39
+
*[8. Classifiers](#8-classifiers)
40
+
*[Naive Bayes](#bayes-classifier)
41
+
*[fastText](#fasttext-classifier)
42
+
*[9. Language identification](#9-language-identification)
43
+
*[10. CRFSuite](#10-crfsuite)
44
+
*[**NLP API Server**](#nlp-api-server)
45
+
*[**Contributing**](#contributing)
46
+
*[**License**](#license)
47
+
21
48
# CLI Utilities
22
49
50
+
## 1. Installation
51
+
23
52
Vntk cli will install nice and easy with:
24
53
25
54
> npm install -g @vntk/cli
26
55
27
-
Then you need to pay attention how to use these cli utilities to preprocess text from files, especially vietnamese that describe at the end of each apis usage. If you wish to improve the tool, please fork and make it better [here](https://github.com/vntk/vntk-cli).
56
+
Then you need to pay attention to how to use these cli utilities to preprocess text from files, especially vietnamese that **describe at the end of each apis usage**. If you wish to improve the tool, please fork and make it better [here](https://github.com/vntk/vntk-cli).
28
57
29
-
#API Usage
58
+
## 2. Usage Example
30
59
31
-
*[1. Tokenizer](#1-tokenizer)
32
-
*[2. Word Segmentation](#2-word-segmentation)
33
-
*[3. POS Tagging](#3-pos-tagging)
34
-
*[4. Chunking](#4-chunking)
35
-
*[5. Named Entity Recognition](#5-named-entity-recognition)
36
-
*[PER LOC ORG](#ner-per-loc-org)
37
-
*[Date time](#ner-date-time)
38
-
*[Custom NER](#ner-custom)
39
-
*[6. Utility](#6-utility)
40
-
*[Dictionary](#dictionary)
41
-
*[Clean html](#clean-html)
42
-
*[7. TF-IDF](#7-tf-idf)
43
-
*[8. Classifiers](#8-classifiers)
44
-
*[Naive Bayes](#bayes-classifier)
45
-
*[fastText](#fasttext-classifier)
46
-
*[9. Language identification](#9-language-identification)
47
-
*[10. CRFSuite](#10-crfsuite)
60
+
After the CLI has installed, you need to open your `Terminal` (or Command Prompt on Windows) and type command you need to use.
61
+
62
+
For instance, the following command will open a file and process it by using Word Tokenizer to tokenize each lines in the file.
63
+
64
+
```bash
65
+
# Process a text file or a folder
66
+
$ vntk ws input.txt --output output.txt
67
+
68
+
# Output file will contain lines which have tokenized.
69
+
```
70
+
71
+
# API Usage
48
72
49
73
## 1. Tokenizer
50
74
@@ -68,8 +92,8 @@ Command line: `vntk tok <file_name.txt>`
68
92
69
93
## 2. Word Segmentation
70
94
71
-
> Vietnamese Word Segmentation using Conditional Random Fields, called: `WordTokenizer`.
72
-
> WordTokenizer helps break text into arrays of words!
95
+
> Vietnamese Word Segmentation using Conditional Random Fields, called: `Word Tokenizer`.
96
+
> Word Tokenizer helps break text into arrays of words!
73
97
74
98
```js
75
99
var vntk =require('vntk');
@@ -256,7 +280,7 @@ vntk clean <file_name1.txt>
256
280
[Term Frequency–Inverse Document Frequency (tf-idf)](http://en.wikipedia.org/wiki/Tf%E2%80%93idf) is implemented to determine how important a word (or words) is to a document relative to a corpus. See following example.
257
281
258
282
```js
259
-
var vntk =require('./lib/vntk');
283
+
var vntk =require('vntk');
260
284
var tfidf =newvntk.TfIdf();
261
285
262
286
tfidf.addDocument('Đại tướng Trần Đại Quang - Ủy viên Bộ Chính trị, Bí thư Đảng ủy Công an Trung ương, Bộ trưởng Bộ Công an.');
* Please use lower camelCase api with custom model.
106
122
*/
107
123
exports.Langid=util.deprecate(exports.langid,'`vntk.Langid()` is depreciated, please use `vntk.langid([custom_model])` instead.')
108
124
exports.getDictionary=util.deprecate(exports.dictionary,'`vntk.getDictionary()` is depreciated, please use `vntk.dictionary([custom_model])` instead.')
109
-
exports.wordSent=util.deprecate(exports.wordTokenizer,'`vntk.wordSent()` is depreciated, please use `vntk.wordTokenizer([custom_model])` instead.')
125
+
exports.wordSent=util.deprecate(exports.wordTokenizer,'`vntk.wordSent()` is depreciated, please use `vntk.wordTokenizer([custom_model])` instead.')
0 commit comments