Skip to content

Commit 5d741a1

Browse files
committed
Update doumentation
1 parent 92653b6 commit 5d741a1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ This package provides only one class - `Ngram`. It models the n-gram.
7272
You can create n-gram from any `SequenceableCollection`:
7373

7474
```Smalltalk
75-
trigram := Ngram withElements: #(do not like).
75+
trigram := AINgram withElements: #(do not like).
7676
tetragram := #(green eggs and ham) asNgram.
7777
```
7878

@@ -82,13 +82,13 @@ Or by explicitly providing the history (n-gram of lower order) and last element:
8282
hist := #(green eggs and) asNgram.
8383
w := 'ham'.
8484
85-
ngram := Ngram withHistory: hist last: w.
85+
ngram := AINgram withHistory: hist last: w.
8686
```
8787

8888
You can also create a zerogram - n-gram of order 0. It is an empty sequence with no history and no last word:
8989

9090
```Smalltalk
91-
Ngram zerogram.
91+
AINgram zerogram.
9292
```
9393

9494
### Accessing
@@ -115,13 +115,13 @@ brown := file contents.
115115
```
116116
#### 2. Training a 2-gram language model on the corpus
117117
```Smalltalk
118-
model := NgramModel order: 2.
118+
model := AINgramModel order: 2.
119119
model trainOn: brown.
120120
```
121121
#### 3. Generating text of 100 words
122122
At each step the model selects top 5 words that are most likely to follow the previous words and returns the random word from those five (this randomnes ensures that the generator does not get stuck in a cycle).
123123
```Smalltalk
124-
generator := NgramTextGenerator new model: model.
124+
generator := AINgramTextGenerator new model: model.
125125
generator generateTextOfSize: 100.
126126
```
127127
## Result:

0 commit comments

Comments
 (0)