Update app.py
Browse files
app.py
CHANGED
|
@@ -7,14 +7,6 @@ import os
|
|
| 7 |
import sys
|
| 8 |
os.system('python -m pip install --upgrade pip')
|
| 9 |
os.system('pip install -U scikit-learn scipy matplotlib')
|
| 10 |
-
#import scikit-learn
|
| 11 |
-
from sklearn import model_selection
|
| 12 |
-
from sklearn.linear_model import LogisticRegression
|
| 13 |
-
from sklearn.tree import DecisionTreeClassifier
|
| 14 |
-
from sklearn.neighbors import KNeighborsClassifier
|
| 15 |
-
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
|
| 16 |
-
from sklearn.naive_bayes import GaussianNB
|
| 17 |
-
from sklearn.svm import SVC
|
| 18 |
os.system("pip install git+https://github.com/openai/whisper.git")
|
| 19 |
import whisper
|
| 20 |
# os.system("pip install numpy==1.20.0")
|
|
@@ -28,37 +20,3 @@ whisper_tiny = whisper.load_model("tiny")
|
|
| 28 |
whisper_base = whisper.load_model("base")
|
| 29 |
|
| 30 |
dataset = load_dataset("mskov/miso_test")
|
| 31 |
-
|
| 32 |
-
names = ['path', 'file_name', 'category']
|
| 33 |
-
dataframe = pandas.read_csv(url, names=names)
|
| 34 |
-
array = dataframe.values
|
| 35 |
-
X = array[:,0:2]
|
| 36 |
-
Y = array[:,2]
|
| 37 |
-
# prepare configuration for cross validation test harness
|
| 38 |
-
seed = 7
|
| 39 |
-
# prepare models
|
| 40 |
-
models = [whisper_esc50, whisper_miso, whisper_tiny, whisper_base]
|
| 41 |
-
models.append(('LR', LogisticRegression()))
|
| 42 |
-
models.append(('LDA', LinearDiscriminantAnalysis()))
|
| 43 |
-
models.append(('KNN', KNeighborsClassifier()))
|
| 44 |
-
models.append(('CART', DecisionTreeClassifier()))
|
| 45 |
-
models.append(('NB', GaussianNB()))
|
| 46 |
-
models.append(('SVM', SVC()))
|
| 47 |
-
# evaluate each model in turn
|
| 48 |
-
results = []
|
| 49 |
-
names = []
|
| 50 |
-
scoring = 'accuracy'
|
| 51 |
-
for name, model in models:
|
| 52 |
-
kfold = model_selection.KFold(n_splits=10, random_state=seed)
|
| 53 |
-
cv_results = model_selection.cross_val_score(model, X, Y, cv=kfold, scoring=scoring)
|
| 54 |
-
results.append(cv_results)
|
| 55 |
-
names.append(name)
|
| 56 |
-
msg = "%s: %f (%f)" % (name, cv_results.mean(), cv_results.std())
|
| 57 |
-
print(msg)
|
| 58 |
-
# boxplot algorithm comparison
|
| 59 |
-
fig = plt.figure()
|
| 60 |
-
fig.suptitle('Algorithm Comparison')
|
| 61 |
-
ax = fig.add_subplot(111)
|
| 62 |
-
plt.boxplot(results)
|
| 63 |
-
ax.set_xticklabels(names)
|
| 64 |
-
plt.show()
|
|
|
|
| 7 |
import sys
|
| 8 |
os.system('python -m pip install --upgrade pip')
|
| 9 |
os.system('pip install -U scikit-learn scipy matplotlib')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
os.system("pip install git+https://github.com/openai/whisper.git")
|
| 11 |
import whisper
|
| 12 |
# os.system("pip install numpy==1.20.0")
|
|
|
|
| 20 |
whisper_base = whisper.load_model("base")
|
| 21 |
|
| 22 |
dataset = load_dataset("mskov/miso_test")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|