Skip to content

Commit

Permalink
Added Decision Tree & Reorganized Imports
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellShibilski-Unkel committed Jun 8, 2024
1 parent 4d9f647 commit 9efc02b
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 5 deletions.
44 changes: 44 additions & 0 deletions PyAI.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Metadata-Version: 2.1
Name: PyAI
Version: 3.5
Summary: PyAI
Author: Mitchell Shibilski-Unkel
Author-email: None
Keywords: python,ai,machine_learning,nlp
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch
Requires-Dist: numpy
Requires-Dist: whisper
Requires-Dist: spacy


# PyAI
This open-source library includes both an RNN and a KNN algorithm. In addition to these algorithms, PyAI offers a simple NLP and adds a way to convert audio into text through *Whisper*.

Clone: `gh repo clone MitchellShibilski-Unkel/PyAI` <br />
Installation: `pip install git+https://github.com/MitchellShibilski-Unkel/PyAI.git@main`

# Algorithms
- RNN
- KNN
- ReLU
- Softmax

# NLP
Able To Do:
- Gets sentence tense
- Gets each word and sentence
- Able to change the type of tokenization `(letters, words, or sentences)`
- Able to get the part of speech of a word

# Audio
Able To Do:
- Able to convert audio to text
- Get the language used in the audio
- Translate one language to another
8 changes: 8 additions & 0 deletions PyAI.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LICENSE
README.md
setup.py
PyAI.egg-info/PKG-INFO
PyAI.egg-info/SOURCES.txt
PyAI.egg-info/dependency_links.txt
PyAI.egg-info/requires.txt
PyAI.egg-info/top_level.txt
1 change: 1 addition & 0 deletions PyAI.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 4 additions & 0 deletions PyAI.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
torch
numpy
whisper
spacy
1 change: 1 addition & 0 deletions PyAI.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added dist/PyAI-3.5-py3.10.egg
Binary file not shown.
13 changes: 10 additions & 3 deletions pyai.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import numpy as np
import whisper
import spacy
import whisper
import numpy as np
from torch import nn
from torch import Tensor
from sklearn.tree import DecisionTreeRegressor


class PyAI:
Expand Down Expand Up @@ -60,6 +61,12 @@ def Softmax(self, x):
soft = nn.Softmax(dim=1).to("cpu")(x)

return soft

def decisionTree(self, trainX: list, trainY: list, words: list):
w = np.array([len(a) for a in words]).reshape(-1, 1)
tree = DecisionTreeRegressor()
tree.fit(trainX, trainY)
return tree.predict(w).tolist()

class Audio:
def __init__(self, audio: str):
Expand Down Expand Up @@ -143,4 +150,4 @@ def getTokens(self):

def getPartOfSpeech(self, text: str):
POS = spacy.load("en_core_web_sm")
return POS(text)[0].tag_
return POS(text)[0].tag_
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
long_description = "\n" + fh.read()

VERSION = 'v3.5'
VERSION = 'v4.0'
DESCRIPTION = 'PyAI'
LONG_DESCRIPTION = '-'

Expand All @@ -21,7 +21,7 @@
long_description_content_type="text/markdown",
long_description=long_description,
packages=find_packages(),
install_requires=['torch', 'numpy', 'whisper', 'spacy'],
install_requires=['torch', 'numpy', 'whisper', 'spacy', 'sklearn'],
keywords=['python', 'ai', 'machine_learning', 'nlp'],
classifiers=[
"Intended Audience :: Developers",
Expand Down

0 comments on commit 9efc02b

Please sign in to comment.