Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit e51bcc1

Browse files
author
Cipher
committed
Update readme
1 parent edad5d1 commit e51bcc1

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

Experimental/.DS_Store

0 Bytes
Binary file not shown.

README.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,24 @@ from Janex.Janex import *
2929

3030
<h4>Using Janex in your code</h4>
3131

32+
<h5>Create an instance</h5>
33+
34+
Before anything else, you need to create an instance of the IntentMatcher class.
35+
36+
```
37+
intents_file_path = "intents.json"
38+
39+
matcher = IntentMatcher(intents_file_path)
40+
```
41+
3242
<h5>Tokenizing:</h5>
3343

3444
To utilise the tokenizer feature, here is an example of how it can be used.
3545

3646
```
3747
input_string = "Hello! What is your name?"
3848
39-
words = Tokenize(input_string)
49+
words = matcher.Tokenize(input_string)
4050
4151
print(words)
4252
```
@@ -48,7 +58,7 @@ To compare the input with the patterns from your intents.json storage file, you
4858
```
4959
intents_file_path = "intents.json"
5060
51-
intent_class = patterncompare(input_string, intents_file_path)
61+
intent_class = matcher.patterncompare(input_string, intents_file_path)
5262
5363
print(intent_class)
5464
```
@@ -58,17 +68,26 @@ print(intent_class)
5868
Sometimes a list of responses in a class can become varied in terms of context, and so in order to get the best possible response, we can use the 'responsecompare' function to compare the input string with your list of responses.
5969

6070
```
61-
62-
BestResponse = responsecompare(input_string, intents_file_path, intent_class)
71+
BestResponse = matcher.responsecompare(input_string, intents_file_path, intent_class)
6372
6473
print(BestResponse)
74+
```
75+
76+
<h5>Using Transformers</h5>
6577

78+
I am still currently learning about complex mathematical Machine Learning algorithms, so the numpy-based transformers included in this project are still in development, and may not always be useful or stable for a while. If you would like to use them for whatever, here's an example.
79+
80+
```
81+
output = matcher.Transform(input_string)
82+
print(output)
6683
```
84+
6785
<h3> Functionality </h3>
6886

69-
<h4>Version 0.0.1</h4>
87+
<h4>Version 0.0.2</h4>
7088

7189
- Word tokenizer ✓
7290
- Intent classifier ✓
7391
- Word Stemmer ✓
7492
- Support for Darwin, Unix-like and Windows ✓
93+
- Simple text transformer ✓

0 commit comments

Comments
 (0)