LearnedVector / A-Hackers-AI-Voice-Assistant

A hackers AI voice assistant, built using Python and PyTorch.
https://www.youtube.com/playlist?list=PL5rWfvZIL-NpFXM9nFr15RmEEh4F4ePZW
MIT License
1.02k stars 358 forks source link

Project dependencies may have API risk issues #108

Open PyDeps opened 2 years ago

PyDeps commented 2 years ago

Hi, In A-Hackers-AI-Voice-Assistant, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

astunparse==1.6.3
audioread==2.1.9
certifi==2020.12.5
dataclasses==0.6
dill==0.3.3
filelock==3.0.12
fsspec==0.8.5
future==0.18.2
gast==0.3.3
joblib==1.0.0
Keras-Preprocessing==1.1.2
llvmlite==0.35.0
matplotlib==3.3.3
nltk==3.5
numba==0.52.0
numpy==1.18.5
oauthlib==3.1.0
pandas==1.1.5
Pillow==8.0.1
protobuf==3.14.0
pydub==0.23.1
pytorch-lightning==1.1.1
regex==2020.11.13
resampy==0.2.2
sacremoses==0.0.43
scikit-learn==0.22.2.post1
scipy==1.4.1
seaborn==0.11.1
sentencepiece==0.1.94
sonopy==0.1.2
SoundFile==0.10.3.post1
tabulate==0.8.7
tensorboard==2.4.0
tensorboard-plugin-wit==1.7.0
tensorflow==2.3.0
tensorflow-estimator==2.3.0
tokenizers==0.9.4
torch==1.7.1
torchaudio==0.5.0
torchtext==0.6.0
torchvision==0.8.2
tqdm==4.54.1
transformers==4.1.1
typing-extensions==3.7.4.3

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict. The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project, The version constraint of dependency future can be changed to >=0.4.0,<=0.5.2. The version constraint of dependency joblib can be changed to >=0.3.2d.dev,<=0.7.0d. The version constraint of dependency joblib can be changed to >=0.3a.dev,<=1.1.0. The version constraint of dependency nltk can be changed to >=3.2.2,<=3.7. The version constraint of dependency pydub can be changed to >=0.8.1,<=0.25.1. The version constraint of dependency scikit-learn can be changed to >=0.13,<=0.20.4. The version constraint of dependency tabulate can be changed to >=0.7.4,<=0.8.9. The version constraint of dependency tqdm can be changed to >=4.42.0,<=4.64.0.

The above modification suggestions can reduce the dependency conflicts as much as possible, and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

The calling methods from the future
open.write
The calling methods from the joblib
joblib.load
The calling methods from the nltk
collections.OrderedDict
The calling methods from the pydub
pydub.utils.make_chunks
pydub.AudioSegment.from_file
The calling methods from the scikit-learn
joblib.load
sklearn.preprocessing.LabelEncoder
sklearn.metrics.precision_recall_fscore_support
sklearn.metrics.confusion_matrix
sklearn.metrics.classification_report
sklearn.preprocessing.LabelEncoder.fit_transform
The calling methods from the tabulate
tabulate.tabulate
The calling methods from the tqdm
itertools.product
The calling methods from the all methods
extract_entity
threading.Thread
self.classification
correct_predictions_intent.double
criterion.backward
extract_entity.values
ast.literal_eval
model.to.parameters
itertools.product
self._init_hidden
self.model.parameters
f.read
decodes.append
self.p.terminate
dataset.Data
self.drop_2
model.to.state_dict
outputs.x.x.torch.stack.mean
sklearn.metrics.confusion_matrix.astype
Listener
f.write
probs.torch.argmax.cpu.detach.numpy
min
matplotlib.pyplot.tight_layout
matplotlib.pyplot.ylabel
torch.max
model.NLUModel.parameters
trace
self.audio_q.pop
list
join_char.join.lower
proccess_itent_scenario_data
Exception
torch.round.eq
target_entity.extend
torchaudio.load
pytorch_lightning.callbacks.ModelCheckpoint
numpy.zeros
engine.SpeechRecognitionEngine
df.filter.apply
torchaudio.transforms.MelSpectrogram
torch.utils.tensorboard.SummaryWriter.add_scalar
matplotlib.pyplot.yticks
re.split
RandomCut
self.mfcc
torch.softmax
criterion.item
self.__getitem__
self.scheduler.step
self.tokenizer.encode_plus
scheduler.step
self.out_intent
self.MFCC.super.__init__
join_char.join
MFCC
self.decoder.decode
torchaudio.transforms.FrequencyMasking
enc.inverse_transform.view
neuralnet.utils.TextProcess.int_to_text_sequence
batch.items
torchaudio.transforms.Resample
flask.request.args.get
ids.extend
sklearn.metrics.confusion_matrix.sum
self.step
waveform.self.featurizer.transpose.transpose
self.norm
batch.view
model.SpeechRecognition
chunk.export
frames.append
model.to.to
self.layernorm.size
pandas.concat
logits.shape.logits.view.cpu.detach
optimizer.zero_grad
TextProcess
torch.optim.lr_scheduler.ReduceLROnPlateau
torch.nn.functional.gelu
probs.torch.argmax.cpu.detach
df.groupby.apply
self.model.eval.to
argparse.ArgumentParser.add_argument
shutil.copy
torch.load
mfcc.to
NLUEngine
binary_accuracy
torchaudio.transforms.TimeMasking
self.device.model_path.torch.jit.load.to.eval
spectrograms.nn.utils.rnn.pad_sequence.unsqueeze.transpose.append
preprocess_raw_df.filter
i.label_lengths.i.labels.tolist
enc.inverse_transform
zip
torch.optim.AdamW
SpeechModule
torch.nn.Dropout
join_char.join.split
self.beam_search.split
torch.long.mask.torch.tensor.unsqueeze
logits.shape.logits.view.cpu.detach.view
label_lengths.append
torch.softmax.numpy
torch.nn.GELU
self.NLUModel.super.__init__
labels.index
pandas.read_csv.head
transformers.get_linear_schedule_with_warmup
model.train.parameters
action
self.dropout2.transpose
model.NLUModel.state_dict
process_entity_data
neuralnet.dataset.get_featurizer
enc.inverse_transform.flatten
time.sleep
torch.utils.tensorboard.SummaryWriter
torch.nn.utils.rnn.pad_sequence
pydub.utils.make_chunks
argparse.ArgumentParser
transformers.AdamW
max
criterion
loss_func
torch.long.token_type_ids.torch.tensor.unsqueeze
mfcc.squeeze.transpose
torch.nn.Linear
get_featurizer
df.answer_normalised.notnull
model
logits.shape.logits.view.cpu
transformers.BertModel.from_pretrained
os.listdir
webbrowser.open_new
self.SpecAugment.super.__init__
sys.path.append
torch.zeros
self.random.choice
torch.Tensor
preprocess_raw_df
model.NLUModel.load_state_dict
ActDropNormCNN1D
torch.save
re.split.split
SpeechRecognitionEngine.run
self.save_transcript
pandas.read_json
torch.long.ids.torch.tensor.unsqueeze.to
intent_scenario_classfication_dataset
label.to
output.torch.argmax.squeeze
make_dataset
torch.utils.tensorboard.SummaryWriter.add_scalars
torch.nn.LSTM
rand_cut
self._forward
SpecAugment
torch.utils.data.DataLoader
self.specaug
string.append
self.featurizer
optimizer.step
save_checkpoint
ctcdecode.CTCBeamDecoder
neuralnet.utils.TextProcess
preprocess_raw_df.apply
torch.optim.AdamW.step
k.replace
threading.Thread.start
df.path.apply
torch.rand.item
self.criterion
x.squeeze.numpy.self.mfcc.torch.Tensor.transpose
utils.test_fn
self.data.describe
x.squeeze.numpy
utils.TextProcess
to_yhat
preprocess_raw_df.fillna
os.rename
self.out_scenario
labels.torch.Tensor.numpy
json.dumps
rounded_preds.y.view_as.rounded_preds.eq.sum.item
v.to
flask.jsonify
self.to_yhat
pytorch_lightning.loggers.TensorBoardLogger
utils.eval_fn
TextProcess.int_to_text_sequence
torch.nn.LayerNorm
interactive
torch.nn.Sequential
self.policy1
numpy.log
model_path.torch.jit.load.to
sklearn.metrics.classification_report
sonopy.mfcc_spec
NLUEngine.predict
torch.nn.functional.log_softmax
self.classes_to_scores_json
wave.open.setsampwidth
wave.open
torch.optim.AdamW.state_dict
file_name.rpartition
threading.Event.wait
self.final_fc
model.NLUModel
loss_fn.item
hs.batch_size.d.n.torch.zeros.to
torch.argmax
torch.flatten
pytorch_lightning.Trainer
self.convert_to_string
pandas.read_csv.groupby
numpy.concatenate
trace.save
super
x.squeeze.numpy.self.mfcc.torch.Tensor.transpose.unsqueeze
df.filter.rename
self.policy2
target_key.batch.cpu
self.p.get_sample_size
self.RandomCut.super.__init__
x.squeeze
torch.optim.lr_scheduler.ReduceLROnPlateau.step
self.stream.stop_stream
s.split.stack
word_errors
self.audio_transform.squeeze
open.write
_levenshtein_distance
self.audio_q.copy
torch.nn.utils.rnn.pad_sequence.append
self.audio_q.clear
queue.append
string.join.replace
EntityDataset
torch.nn.functional.softmax
rand_cut.append
IntentScenarioDataset
torch.cuda.is_available
wave.open.setnchannels
DemoAction
probs.torch.argmax.cpu
spectrograms.nn.utils.rnn.pad_sequence.unsqueeze
char_map_str.strip.split
self.p.open
pydub.AudioSegment.from_file
torch.utils.tensorboard.SummaryWriter.close
int
float
torch.stack
flask.Flask.route
file.endswith
model.LSTMWakeWord.load_state_dict
model.LSTMWakeWord
matplotlib.pyplot.text
char_errors
torch.optim.lr_scheduler.ReduceLROnPlateau.state_dict
flask.Flask.run
flask.request.args.get.split
model.train.train
sklearn.metrics.confusion_matrix
idx.item.item
os.path.isdir
self.tokenizer.encode
wave.open.writeframes
entity.words.pd.concat.reset_index
df.filter.drop
self.model._init_hidden.to
get_precision_recall
results.split
test
model.LSTMWakeWord.eval
self.entity_extraction
y.view_as
torch.argmax.numpy
main
tabulate.tabulate
self.listener.p.get_sample_size
mask.view
torch.no_grad
self.enc_entity.inverse_transform
model.SpeechRecognition.load_state_dict
pyaudio.PyAudio
matplotlib.pyplot.xticks
criterion.ignore_index.torch.tensor.type_as
self.SpeechModule.super.__init__
ValueError
extract_words
spectrograms.nn.utils.rnn.pad_sequence.unsqueeze.transpose
torch.long.ids.torch.tensor.unsqueeze
self.beam_search
decode.append
threading.Event
torch.tensor
torch.nn.utils.clip_grad_norm_
self.predict
self.drop_3
self.tokenizer.decode
WakeWordEngine
model.SpeechRecognition._init_hidden
dataset.WakeWordData
dataset.NLUDataset
self.save
self.words_to_scores_json
self.subprocess.check_output
self.drop_1
os.mkdir
self.sentence_to_labels_json
losses.append
self.LogMelSpec.super.__init__
extract_words.values
WakeWordEngine.run
torch.long.mask.torch.tensor.unsqueeze.to
rand_cut.transpose
print
torch.manual_seed
fig_dict.items
self.layernorm
loss_fn
pytorch_lightning.Trainer.fit
model.NLUModel.to
self.LSTMWakeWord.super.__init__
wave.open.setframerate
self.stream.close
os.path.dirname
collections.defaultdict
SpeechModule.load_from_checkpoint
model_state_dict.items
matplotlib.pyplot.title
Listener.save_audio
self
torch.sigmoid
correct_predictions_scenario.double
torch.where
pandas.read_csv
model.SpeechRecognition.eval
sklearn.preprocessing.LabelEncoder.fit_transform
torch.nn.CTCLoss
self.listener.run
numpy.arange
self.text_process.text_to_int_sequence
torch.sum
pred.torch.round.torch.flatten.cpu
torch.nn.CrossEntropyLoss
self.asr_results.split
NLUDataset
csv.DictReader
self.SpeechRecognition.super.__init__
pydub.AudioSegment.from_mp3.export
torch.is_tensor
get_confusion_matrix
sum
listener.stream.read
str
rounded_preds.y.view_as.rounded_preds.eq.sum
transformers.BertTokenizer.from_pretrained
os.path.realpath
torch.round.item
char_map_str.strip
line.split
join
flask.render_template
self.sentence_prediction
self.play
waveform.self.featurizer.unsqueeze
torch.device
torch.optim.AdamW.zero_grad
self.specaug2
int_sequence.append
len
entity_recognition_dataset
self.model._init_hidden
targets.append
h_params.update
self.stream.read
torch.rand
out.transpose.transpose
filter
self.model.eval
sklearn.metrics.confusion_matrix.max
torch.round
wave.open.close
matplotlib.pyplot.colorbar
collections.OrderedDict
classifcation_report
enumerate
self.out_entity
self.bert
df.answer_annotation.notnull
data.append
torch.randint
torch.jit.trace
inputs.self.tokenizer.decode.split
sklearn.metrics.precision_recall_fscore_support
decoder.CTCBeamDecoder
preds_entity.view
matplotlib.pyplot.figure
index.item
model.train.eval
file.split
sklearn.preprocessing.LabelEncoder
self.transform
run
format
label.torch.flatten.cpu
self.dropout
plot_confusion_matrix
self.words_to_labels_json
numpy.around
torch.cat
random.shuffle
self.process_sentence
accs.append
self.classifier
engine.SpeechRecognitionEngine.run
torch.jit.load
flask.Flask
utils.train_fn
torch.nn.BCEWithLogitsLoss
range
os.path.join
self.audio_transforms
join.stack
self.layer_norm2
self.cnn
input_lengths.append
self.dense
model.eval
pydub.AudioSegment.from_mp3
open
args.file_path.rpartition
torch.Tensor.append
self.sr.sr.torchaudio.transforms.Resample
torch.nn.Conv1d
torch.utils.tensorboard.SummaryWriter.add_figure
argparse.ArgumentParser.parse_args
self.dropout2
self.model
logits.view.view
matplotlib.pyplot.xlabel
spectrogram.squeeze.transpose
self.lstm
LogMelSpec
self.ActDropNormCNN1D.super.__init__
sklearn.model_selection.train_test_split
chunk_and_save
waveform.self.featurizer.transpose
self.audio_transforms.squeeze
loss_fn.backward
correct_predictions_entity.double
checkpoint_callback
torch.long.token_type_ids.torch.tensor.unsqueeze.to
self.dropout2.squeeze
joblib.load
matplotlib.pyplot.imshow
SpeechRecognitionEngine
d_params.update
input
preds.torch.Tensor.numpy
train
self.audio_transform
probs.torch.argmax.cpu.detach.numpy.flatten

@developer Could please help me check this issue? May I pull a request to fix it? Thank you very much.