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
{{ message }}
This repository was archived by the owner on Feb 8, 2024. It is now read-only.
A free open-source framework which can be used to build Machine Learning tools, LLMs, and Natural Language Processing scripts with full simplicity.
16
15
17
-
<h2> What is the purpose of Janex? </h2>
16
+
Janex-Python is a library which can be used to create Natural Language Processing-based programs and other forms of Artificial Intelligence.
18
17
19
-
Monopolistic companies are confining their Artificial Intelligence research to themselves, and capitalising on it. Even companies that swore to open source their software (OpenAI) went back on their morals, with the releases of GPT-3+, as did other powerful businesses.
18
+
It is part of the Janex eco-system which is designed for developers to use in their own projects for free, licensed under the Free Lily License.
20
19
21
-
Released under the **new** Free Lily License 1.0, Janex will improve and become a useful tool for users to conduct their own research in the potential of Artifical Intelligence.
20
+
As of update 0.0.80, the entire infrastructure of how this code works has been modified intensely.
22
21
23
-
If you want to use a more heavyweight but more accurate version of Janex, I would recommend using Janex: PyTorch Edition, which uses Neural Network techniques from PyTorch and NLTK to enhance the prediction accuracy.
24
-
```
25
-
https://pypi.org/project/JanexPT/0.0.1/#files
26
-
```
27
-
28
-
<h3> How to use </h3>
29
-
30
-
<h5> Adding to your project </h5>
22
+
### How to use
31
23
32
-
Firstly, you'll need to install the library using the Python pip package manager.
24
+
First, install Janex using pip.
33
25
34
-
```
26
+
```bash
35
27
python3 -m pip install Janex
36
-
37
-
```
38
-
Secondly, you need to import the library into your Python script.
39
-
40
28
```
29
+
Next, import it into your code
30
+
```python
41
31
from Janex import *
42
32
```
43
33
44
-
<h4>Using Janex in your code</h4>
45
-
46
-
<h5>Create an instance</h5>
34
+
### Intent classifier
47
35
48
-
Before anything else, you need to create an instance of the IntentMatcher class. (If you do not have one made already, the program will automatically download a pre-written file created by @SoapDoesCode - big thanks to her for their intents file!)
36
+
To use the pre-built intent classifier included with the package, you need to create an instance of it and then set the intents, vectors and dimensions.
Optional: If you would like to update your thesaurus to your most recent pre-written file, then you can add this code to check for new versions and to download them. Be careful though, this function removes your thesaurus file, which means any unsaved data which doesn't exist on the pre-written file will be erased. (But could possibly be restored in your bin directory)
44
+
Classifier.set_intentsfp("intents.json")
45
+
Classifier.set_vectorsfp("vectors.json")
46
+
Classifier.set_dimensions(300)
59
47
60
-
```
61
-
matcher.update_thesaurus()
48
+
Classifier.train_vectors()
62
49
```
63
50
64
-
<h5>Tokenizing:</h5>
51
+
You can then determine the class of which a certain variable belongs in using the Classifier.claffy() function.
65
52
66
-
To utilise the tokenizer feature, here is an example of how it can be used.
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.
In experimental phase but included in 0.0.15 and above, the 'ResponseGenerator' function can absorb the response chosen by your response comparer from your intents.json file, and then modify it, replacing words with synonyms, to give it a more unscripted response.
81
+
input_string = "Hello, my name is Sheila."
99
82
100
-
For this to be used, if you haven't got a thesaurus.json file already, the IntentMatcher will automatically download the pre-written example directly from Github and into your chatbot folder.
83
+
vectors = string_vectorize(input_string)
101
84
102
-
After doing so, you may include the feature in your code like this.
85
+
vectors = reshape_array_dimensions(vectors, 300) # To reshape the vector array
Warning: This feature is still work-in-progress, and will only be as effective per the size of your thesaurus file, so don't expect it to be fully stable until I have fully completed it. :)
0 commit comments