No project description provided
Project description
Janex
Janex-Python is a library which can be used to create Natural Language Processing-based programs and other forms of Artificial Intelligence.
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.
As of update 0.0.80, the entire infrastructure of how this code works has been modified intensely.
How to use
First, install Janex using pip.
python3 -m pip install Janex
Next, import it into your code
from Janex import *
Intent classifier
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.
from janex.intentclassifier import *
Classifier = IntentClassifier()
Classifier.set_intentsfp("intents.json")
Classifier.set_vectorsfp("vectors.json")
Classifier.set_dimensions(300)
Classifier.train_vectors()
You can then determine the class of which a certain variable belongs in using the Classifier.claffy() function.
Input = input("You: ")
classification = Classifier.classify(Input)
response = random.choice(classification["responses"])
print(response)
Data experimentation with vectors
If you would like to tokenize, stem or otherwise preprocess data, the Janex library comes with some pre-made tools.
To tokenize:
from Janex.word_manipulation import *
string = "Hello. My name is Brendon."
tokens = tokenize(string)
print(tokens)
To vectorize:
from Janex.vectortoolkit import *
input_string = "Hello, my name is Sheila."
vectors = string_vectorize(input_string)
vectors = reshape_array_dimensions(vectors, 300) # To reshape the vector array
secondstring = "Hello, my name is Robert."
second_vectors = string_vectorize(secondstring)
second_vectors = reshape_array_dimensions(second_vectors, 300)
similarity = calculate_cosine_similarity(vectors, second_vectors)
print(similarity)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Janex-0.0.80.tar.gz
.
File metadata
- Download URL: Janex-0.0.80.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39b9e9937c711f4d1a7690d2ce84335ed70380eb57ec314b317707e3d4b20234 |
|
MD5 | 4c25375b77548769beea2da9236cd2d0 |
|
BLAKE2b-256 | ab2f249dde29ce9d47d2d24b8bbd6c4ba157fd90a2a72d99991e22e5dfac656f |